trino-python-client icon indicating copy to clipboard operation
trino-python-client copied to clipboard

Handle HTTP 429 responses

Open aalbu opened this issue 10 months ago • 0 comments

Describe the feature

In production, Trino is almost always deployed behind some sort of proxy. It's not uncommon for these proxies to employ some rate limiting mechanism, which typically responds to requests with HTTP 429 (Too Many Requests) to high load. The response might contain a Retry-After header that indicates either the number of seconds the client should wait before retrying the request or the date when the request can be retried.

The Trino Python Client should handle such responses by retrying the request. Incidentally, HTTP 503 (Service Unavailable), which is currently being retried, can also include a Retry-After header, which is not taken into account currently.

Describe alternatives you've considered

No response

Are you willing to submit PR?

  • [ ] Yes I am willing to submit a PR!

aalbu avatar Mar 29 '24 20:03 aalbu