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

Retry for 50X HTTP Status for GET, POST Methods #128

Open
kar0t opened this issue Nov 9, 2024 · 2 comments
Open

Retry for 50X HTTP Status for GET, POST Methods #128

kar0t opened this issue Nov 9, 2024 · 2 comments

Comments

@kar0t
Copy link
Contributor

kar0t commented Nov 9, 2024

Hi. Currently, the trino-client-ruby library only performs retries for 503 HTTP status codes.

However, according to the trino client protocol, it should also retry for 502 and 504.

If the client request returns an HTTP 502, 503, or 504, that means there was an intermittent problem processing request and the client should try again in 50-100 ms. Trino does not generate those codes by itself, but those can be generated by load balancers in front of Trino.

We would appreciate a code fix for this.

@yuokada
Copy link
Contributor

yuokada commented Nov 11, 2024

@kar0t Thanks for sending the pull request.
The new package that includes your change is available.
https://rubygems.org/gems/trino-client/versions/2.2.1

@kar0t kar0t changed the title Retry for 50X HTTP Status Retry for 50X HTTP Status for GET Methof Dec 10, 2024
@kar0t kar0t changed the title Retry for 50X HTTP Status for GET Methof Retry for 50X HTTP Status for GET Method Dec 10, 2024
@kar0t kar0t reopened this Dec 10, 2024
@kar0t kar0t changed the title Retry for 50X HTTP Status for GET Method Retry for 50X HTTP Status for GET, POST Methods Dec 10, 2024
@kar0t
Copy link
Contributor Author

kar0t commented Dec 10, 2024

The Ruby Client has been modified to retry in case of GET failures, but the POST method does not yet retry.
I suggest a fix for this. Below is the POST Retry implementation in the Trino Python Client for reference.

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

No branches or pull requests

2 participants