Backport: Add _retry_server_directed_only mode for Retry-After header compliance#757
Conversation
When enabled, the connector only retries on 429/503 if the server includes a Retry-After header in the response. This prevents duplicate side effects for non-idempotent ExecuteStatement operations where the server has not explicitly signaled that retry is safe. The new opt-in parameter `_retry_server_directed_only` threads through ClientContext, all three DatabricksRetryPolicy construction sites (Thrift, SEA, UnifiedHttpClient), and the retry policy's should_retry/is_retry methods. Default behavior (retry without requiring the header) is unchanged. Signed-off-by: Shubham Dhal <shubham.dhal@databricks.com>
Inline kwargs.get() at the single point of use in ThriftDatabricksClient and SeaHttpClient instead of storing as dead instance state. Signed-off-by: Shubham Dhal <shubham.dhal@databricks.com>
- Rename server_directed_only to respect_server_retry_after_header throughout for clarity - Store _respect_server_retry_after_header as instance variable in Thrift/SEA backends to match existing kwargs extraction pattern - Replace duplicate test fixture with _make_retry_policy(**overrides) helper for flexible policy construction in tests Signed-off-by: Shubham Dhal <shubham.dhal@databricks.com>
Signed-off-by: Shubham Dhal <shubham.dhal@databricks.com>
- Update actions/checkout@v2 → v4 and actions/setup-python@v2 → v5 in run-unit-tests-with-arrow job - Pin Poetry version to 2.2.1 across all workflow files - Reduce long-running query test min duration from 3 to 2 minutes Co-authored-by: Isaac
|
Thanks for your contribution! To satisfy the DCO policy in our contributing guide every commit message must include a sign-off message. One or more of your commits is missing this message. You can reword previous commit messages with an interactive rebase ( |
|
Thanks for your contribution! To satisfy the DCO policy in our contributing guide every commit message must include a sign-off message. One or more of your commits is missing this message. You can reword previous commit messages with an interactive rebase ( |
|
Thanks for your contribution! To satisfy the DCO policy in our contributing guide every commit message must include a sign-off message. One or more of your commits is missing this message. You can reword previous commit messages with an interactive rebase ( |
|
Thanks for your contribution! To satisfy the DCO policy in our contributing guide every commit message must include a sign-off message. One or more of your commits is missing this message. You can reword previous commit messages with an interactive rebase ( |
Summary
Backport of #756 to
release/v4.1.5for patch release._respect_server_retry_after_headerconnection parameter that restricts retries to only occur when the server includes aRetry-Afterheader in the responseExecuteStatementoperations where the server has not explicitly signaled that retry is safeClientContext, all threeDatabricksRetryPolicyconstruction sites (Thrift, SEA, UnifiedHttpClient), and the retry policy'sshould_retry/is_retrymethodsTest plan
tests/unit/test_retry.pypoetry run python -m pytest tests/unit/test_retry.py)