Skip to content

Commit

Permalink
Updated retry timeout (#497)
Browse files Browse the repository at this point in the history
* Updated the retry_logic

* Added logging for checking retry time
  • Loading branch information
jprakash-db authored Jan 31, 2025
1 parent 4c62c69 commit fc9da22
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/databricks/sql/auth/retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,9 @@ def sleep_for_retry(self, response: BaseHTTPResponse) -> bool:
else:
proposed_wait = self.get_backoff_time()

proposed_wait = min(proposed_wait, self.delay_max)
proposed_wait = max(proposed_wait, self.delay_max)
self.check_proposed_wait(proposed_wait)
logger.debug(f"Retrying after {proposed_wait} seconds")
time.sleep(proposed_wait)
return True

Expand Down
2 changes: 1 addition & 1 deletion src/databricks/sql/thrift_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
# - 900s attempts-duration lines up w ODBC/JDBC drivers (for cluster startup > 10 mins)
_retry_policy = { # (type, default, min, max)
"_retry_delay_min": (float, 1, 0.1, 60),
"_retry_delay_max": (float, 30, 5, 3600),
"_retry_delay_max": (float, 60, 5, 3600),
"_retry_stop_after_attempts_count": (int, 30, 1, 60),
"_retry_stop_after_attempts_duration": (float, 900, 1, 86400),
"_retry_delay_default": (float, 5, 1, 60),
Expand Down

0 comments on commit fc9da22

Please sign in to comment.