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

fix(forwarding): Change HTTP response for upstream timeouts from 502 to 504 #859

Merged
merged 10 commits into from
Mar 19, 2021

Conversation

untitaker
Copy link
Member

@untitaker untitaker commented Nov 30, 2020

Fix RELAY-93

@untitaker untitaker requested a review from a team November 30, 2020 10:25
@@ -75,6 +75,7 @@ impl ResponseError for ForwardedUpstreamRequestError {
HttpError::ActixPayload(e) => e.error_response(),
HttpError::ActixJson(e) => e.error_response(),
},
UpstreamRequestError::SendFailed(_) => HttpResponse::GatewayTimeout().finish(),
Copy link
Member

Choose a reason for hiding this comment

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

This should be a 500 instead of a 502, since it indicates a failure to build the request, correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

this error actually needs more destructuring

Copy link
Member

Choose a reason for hiding this comment

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

Can we instead map all relevant errors to UpstreamRequestError kinds? It is rather unfortunate having to destructure errors like this since it is too easy to miss cases, as shown by this PR.

@untitaker untitaker requested a review from jan-auer November 30, 2020 11:54
Copy link
Member

@jan-auer jan-auer left a comment

Choose a reason for hiding this comment

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

Since this is a change in behavior, it would be great to add a changelog entry before merging.

@jan-auer
Copy link
Member

@untitaker can you update this?

@untitaker untitaker force-pushed the fix/forwarding-gateway-timeout branch from e34755d to e23f36f Compare March 17, 2021 12:16
@untitaker untitaker changed the title fix: Fix timeout handling of forwarding endpoint fix(forwarding): Change HTTP response for upstream timeouts from 502 to 504 Mar 17, 2021
@untitaker untitaker requested review from RaduW and jan-auer March 17, 2021 12:37
@untitaker untitaker enabled auto-merge (squash) March 19, 2021 11:01
@untitaker untitaker merged commit 69ea04e into master Mar 19, 2021
@untitaker untitaker deleted the fix/forwarding-gateway-timeout branch March 19, 2021 11:05
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.

3 participants