Fix driver behavior on TruncateError handling - stop retrying on permanent failures#632
Open
Fix driver behavior on TruncateError handling - stop retrying on permanent failures#632
Conversation
|
@copilot - please complete the work here. |
Co-authored-by: mykaul <4655593+mykaul@users.noreply.github.com>
Co-authored-by: mykaul <4655593+mykaul@users.noreply.github.com>
… test comment Co-authored-by: mykaul <4655593+mykaul@users.noreply.github.com>
Author
Work completed! The issue has been fixed in commit 9222b2e. Summary of changes:
The driver now correctly handles TruncateError as a permanent failure that should not be retried. |
Copilot
AI
changed the title
[WIP] Fix driver behavior on TruncateError handling
Fix driver behavior on TruncateError handling - stop retrying on permanent failures
Jan 7, 2026
mykaul
reviewed
Jan 9, 2026
Keep TruncateError in the error tuple but check for it specifically within the block to avoid retry logic. This makes it clearer that TruncateError is similar to other request errors but requires different handling. Co-authored-by: mykaul <4655593+mykaul@users.noreply.github.com>
mykaul
approved these changes
Jan 9, 2026
mykaul
reviewed
Jan 13, 2026
| @@ -0,0 +1,59 @@ | |||
| # Copyright DataStax, Inc. | |||
There was a problem hiding this comment.
Unsure that's the right copyright. @dkropachev ? It's our code, our test?
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.
Description
This PR fixes the issue where the Python driver incorrectly retries
TRUNCATE_ERROR(0x1003), which should not be retried as it indicates a permanent failure rather than a transient error.Problem
TruncateErrorwas grouped with transient errors (OverloadedErrorMessage,IsBootstrappingErrorMessage,ServerError) that triggerretry_policy.on_request_error()RETRY_NEXT_HOST, causing unnecessary retries on other hostsSolution
TruncateErrorin the error tuple with similar request errors for better code organizationTruncateErrorTruncateErrornow immediately rethrows without retry, sharing logging and metrics code with other request errorsTruncateErroris not retriedNote: Investigation confirmed that server error messages are already properly included in
TruncateErrorexceptions via the baseErrorMessageclass's__str__method, so no changes were needed for that aspect.Changes Made
TruncateErrorhandling for better readability while preventing retry logicTruncateErrorremains in the error tuple (line 4779) to show its relationship to other request errorsTruncateErrorTruncateErrorTruncateErrormessage handling and error code verificationTesting
TruncateErrorbehaviorTruncateErrorno longer triggers retriesPre-review checklist
./docs/source/.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.