cloud-sql-python-connector
cloud-sql-python-connector copied to clipboard
fix: retry 50x errors with exponential backoff
This commit adds retry behavior to the two SQL Admin API calls.
Any response that results in a 50x error will now be retried up to 5 times with exponential backoff and jitter between each attempt.
The formula used to calculate the duration to wait is:
200ms * 1.618^(attempt + jitter)
This calculation matches what the Cloud SQL Proxy v1 did and will not trigger any significant change in load on the backend.