-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Extend the list of status codes retried in client #16491
Conversation
client/trino-client/src/main/java/io/trino/client/StatementClientV1.java
Outdated
Show resolved
Hide resolved
2a1bfe6
to
360bfcd
Compare
updated - there was a bug there actully (== instead of !=) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should retry arbitrary 5xx code. Not all are appropriate, for example
- 501 Not Implemented
- 505 HTTP Version Not Supported
We could retry on these:
- 502 Bad Gateway
- 503 Service Unavailable
- 504 Gateway Timeout
We also need to update docs/src/main/sphinx/develop/client-protocol.rst
to match this change in the protocol specification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to update the check in HttpTokenPoller
as well, which will permanently fail the request if it is not 200 or 503.
@@ -27,8 +27,11 @@ only required on the initial ``POST`` request, and not when following the | |||
``nextUri`` links. | |||
|
|||
If the client request returns an HTTP 503, that means the server was busy, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trino actually doesn't return 503. That was the intended code for gateways, etc., but in practice, we need to support 502, 503, 504, so we can just mention all three here. In other words, don't differentiate between them here, just list all three.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reworded docuementation.
Good point. Updated that one too. |
This commit extends list of codes on which client will retry to: * HTTP_BAD_GATEWAY (502) * HTTP_UNAVAILABLE (503) * HTTP_GATEWAY_TIMEOUT(504)
@electrum should be good to go now IMO |
Thanks for fixing this. I had this patch in our local version for a while as we had issues with trino-client code and the proxy layer before trino-server. A similar fix was suggested for trino-python-client as well. |
This commit extends list of codes on which client will retry to:
Release notes
(x) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
( ) Release notes are required, with the following suggested text: