Open davidemerritt opened 2 years ago
Retry backoff logic can be set by providing a backoff_policy
on connection. The default backoff policy is exponential backoff:
https://github.com/snowflakedb/snowflake-connector-python/blob/91aa0fcd23c1d87d069cd9989963c8fbcd1091cf/src/snowflake/connector/connection.py#L183
Retries will occur (with timing determined by the backoff policy) until the timeout is hit. But there is no default timeout, so retries will continue forever unless a network_timeout
is provided on connection or a timeout
during execute
:
This is used here:
What is the current behavior?
The retry behavior when snowflake responds with a 503 is not controllable. It currently retries 10 times with a jittered 15s backoff.
What is the desired behavior?
Being able to control this either via a global override or the client connection option would be desirable. This would allow for our application logic to handle these errors or do longer backoffs so we don't send barrage the service with more requests when it can't respond.
How would this improve
snowflake-connector-python
?Add more configuration and flexibility to the python client.
References, Other Background
Please expose configuration for
MAX_DOWNLOAD_RETRY
andDecorrelateJitterBackoff