update FilesExt retry logic#1211
Conversation
45745d5 to
969720e
Compare
databricks/sdk/retries.py
Outdated
|
|
||
| # Determine which limit was hit | ||
| if max_attempts is not None and attempt > max_attempts: | ||
| raise TimeoutError(f"Exceeded max retry attempts ({max_attempts})") from last_err |
There was a problem hiding this comment.
Do we have a better error to represent this error? TimeoutError feels a bit odd for this case, as the function is not actually timed out.
There was a problem hiding this comment.
Ideally we should use a custom type RetryError, with TimeoutError and MaxRetryExceededError as it's derived types, so that the user can catch the RetryError if they don't care why the retry exhausted, while keeping the information.
However since we have been using built-in TimeoutError and users may already be depending on this behavior, it is risky to change it to a different Error.
If we were to introduce a new type of error for max retry exceeded scenario, it would be more difficult for the upper layer to handle the retry error: it needs to catch both Errors manually.
I don't see a better solution here, unless we can rewrite the retry logic completely, or make FilesExt using a different retry library.
There was a problem hiding this comment.
So, you finally changed this to RuntimeError, right? I think it is fine to throw that, as I don't want any other function to depend on that error.
87e5849 to
2cfa627
Compare
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
What changes are proposed in this pull request?
WHAT
max_attemptto allow client to retry and fail after certain amountWHY
How is this tested?
Unit tests were updated to reflect the change.