SameerMesiah97 opened a new pull request, #61796:
URL: https://github.com/apache/airflow/pull/61796
**Description**
Introduced retry logic for OAuth token requests in `SnowflakeHook`. The HTTP
call was extracted into `_request_oauth_token`, and retry handling was added
using `tenacity`, with retry classification implemented in
`_is_retryable_oauth_error`. Retry applies only to connection/timeout errors
and HTTP 5xx responses.
`_get_valid_oauth_token` now delegates access token requests to
`_request_oauth_token`, which performs the HTTP call with retry behavior.
Fail-fast semantics are preserved for non-retryable errors (e.g., HTTP 4xx).
**Rationale**
OAuth token requests can fail due to transient network issues or temporary
upstream server errors. Retrying connection errors, timeouts, and HTTP 5xx
responses improves robustness without masking configuration or credential
issues, which continue to fail immediately.
**Tests**
Added unit tests that:
* Verify retries on connection errors and HTTP 5xx responses.
* Ensure HTTP 4xx errors do not trigger retries.
* Ensure retries are capped at three attempts and that `ConnectionError` is
propagated when retries are exhausted.
**Documentation**
Updated the `get_oauth_token` docstring to clarify that it may retry on
transient failures during token acquisition.
**Notes**
* Retry uses exponential backoff with a fixed maximum number of attempts.
* Retry logic applies only to OAuth token acquisition.
**Backwards Compatibility**
Method signatures of public APIs have not been altered. The public API
`get_oauth_token` now retries on retryable errors via `_get_valid_oauth_token`
and `_request_oauth_token`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]