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: end error response should be gateway timeout or bad gateway #99

Merged
merged 2 commits into from
Nov 8, 2022

Conversation

vasco-santos
Copy link
Contributor

@vasco-santos vasco-santos commented Oct 12, 2022

If content is not resolved by any of the caching layers, nor gateway race tiers we currently return one of the errors from the public gateways in the race.
We should just return a gateway timeout / bad gateway error to the user instead. Alternatively, we could return a 404 but 404 looks less true representation of the error given we trigger timeouts on each race contestants

Closes #90

@alanshaw
Copy link
Member

I'm not sure we should always say we timed out...

If we timed out we should respond with 504 Gateway Timeout.

If all requests errored then we should return 502 Bad Gateway.

@vasco-santos vasco-santos changed the title fix: end error response should be timeout fix: end error response should be gateway timeout or bad gateway Oct 12, 2022
@vasco-santos vasco-santos force-pushed the fix/end-error-response-should-be-timeout branch 2 times, most recently from 6eb6bf7 to 0750412 Compare October 12, 2022 12:58
@vasco-santos vasco-santos force-pushed the fix/end-error-response-should-be-timeout branch from 0750412 to 3c30b48 Compare October 12, 2022 12:59
@vasco-santos
Copy link
Contributor Author

@alanshaw I agree and did a new iteration here. So now, if we get all race contestants to timeout we return 504 Gateway Timeout. If at least one fails without timeout we return 502 Bad Gateway.

Needed to skip these 2 error codes in edge-gateway or these errors would get reported to Sentry

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.

Return custom error instead of gateway race if all fail
2 participants