[mason] Retry transient API errors and stop rendering None on message-less failures - #528
Open
annzhang-db wants to merge 3 commits into
Open
[mason] Retry transient API errors and stop rendering None on message-less failures#528annzhang-db wants to merge 3 commits into
None on message-less failures#528annzhang-db wants to merge 3 commits into
Conversation
…ge-less failures Session-store (and other agents/v1) commands could fail with the unhelpful `Error [CANCELLED]: None` and only succeed on a second try. Two fixes: - `client._do` now retries transient gRPC-style codes (CANCELLED, UNAVAILABLE, DEADLINE_EXCEEDED, ABORTED) with a short backoff before surfacing them. The SDK only retries connection/timeout errors, not these error-code responses. - `wrap_api_error` no longer prints the literal "None" a message-less DatabricksError stringifies to; it falls back to the error code and adds a "usually transient — re-run" hint for the transient codes. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
annzhang-db
force-pushed
the
mason-transient-error-retry
branch
from
September 3, 2026 18:34
7895a33 to
d0c2371
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mason dev -s <store>(and other agents/v1 commands) could fail with an unhelpfulError [CANCELLED]: Nonethat only succeeded on a second try. Two independent causes:CANCELLEDwith no message. The databricks SDK stringifies a message-less error as the literal"None", and our fallback treated that non-empty string as a real message and printed it verbatim.This PR:
CANCELLED,UNAVAILABLE,DEADLINE_EXCEEDED,ABORTED) once for requests that are safe to replay: reads, read-only search, and exclusive store creation. Stateful operations such as session-item append and pop are never retried because the first attempt may have committed even when its response was lost. Duplicate store creation surfacesALREADY_EXISTS, which the ensure-store callers already reconcile as success.None: falls back to the error code and adds a "usually transient — re-run" hint for these codes.Found during the Custom Agents bug bash.
This pull request and its description were written by Isaac.