-
Notifications
You must be signed in to change notification settings - Fork 573
SNOW-3984430: Missing retries for OAuth authentication #3003
Open
Description
Python version
3.14
Operating system and processor architecture
linux-64
Installed packages
does not matter
What did you do?
Using SnowflakeConnection with authenticator=OAUTH_CLIENT_CREDENTIALS does not retry (temporary) failures in the HTTP requests that obtain the access token from the configured oauth_token_request_url.
Such retries do exist in nearby code paths; see retry loop in SnowflakeConnection._authenticate, e.g. here:
snowflake-connector-python/src/snowflake/connector/connection.py
Lines 2083 to 2092 in 869bcf9
while True:
try:
auth_instance.handle_timeout(
authenticator=self._authenticator,
service_name=self.service_name,
account=self.account,
user=self.user,
password=self._password,
)
auth.authenticate(
So I think this is a bug. This call to auth_instance.prepare which does the request should also be covered in a retry loop:
auth_instance.prepare(
What did you expect to see?
Retries in case of temporary failures.