Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the appropriate HTTP response code for backend timeouts #1313

Merged

Conversation

robstradling
Copy link
Contributor

@robstradling robstradling commented Jan 17, 2024

Upon timeout or cancellation of a backend connection context, CTFE currently returns HTTP 408 to the client. This seems wrong, because 408 is intended to mean that the client did not send its request quickly enough.

HTTP 504 (Gateway Timeout) seems a more appropriate error code, given that the timeout or cancellation occurred because an "upstream server" (i.e., the Trillian backend) did not respond quickly enough:

The 504 (Gateway Timeout) status code indicates that the server,
while acting as a gateway or proxy, did not receive a timely response
from an upstream server it needed to access in order to complete the
request.

Checklist

@robstradling robstradling requested a review from a team as a code owner January 17, 2024 11:02
@robstradling robstradling requested review from jiggoha and removed request for a team January 17, 2024 11:02
@mhutchinson
Copy link
Contributor

/gcbrun

@mhutchinson
Copy link
Contributor

/gcbrun

Copy link
Contributor

@mhutchinson mhutchinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mhutchinson mhutchinson merged commit c83d4d3 into google:master Jan 17, 2024
6 checks passed
@robstradling robstradling deleted the http_response_for_backend_timeouts branch January 17, 2024 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants