fix: reset backoff counter per-record on success to prevent compounding delay after chaos recovery - #274
Merged
Conversation
…ng delay after chaos recovery After a chaos/outage window, consecutiveUnavailableException can grow large (e.g. 5+ retries during a 30s partition). Previously the counter only reset after the entire batch completed, so subsequent records in the same batch inherited the high counter and slept for seconds before their first retry — even though CQL was already recovering. In testConnectionFailure this caused the 240s consumer receive timeout to expire before all 3 messages were delivered. Fix: reset consecutiveUnavailableException to 0 each time a single record's CQL query succeeds in waitForCqlWithRetry (both KafkaCassandraSourceTask and CassandraSource). The end-of-batch reset at poll() is kept as a redundant safety net.
dlg99
approved these changes
Sep 24, 2026
dlg99
left a comment
There was a problem hiding this comment.
LGTM.
Is it covered by tests?
Also, I'd rename consecutiveUnavailableException to consecutiveUnavailableExceptionCount or similar
…lableExceptionCount and add unit tests
heesung-sohn
force-pushed
the
feat/kafka-support-heesung
branch
from
September 24, 2026 18:49
2455316 to
e489764
Compare
Author
added test cases and renamed the var. |
dlg99
approved these changes
Sep 24, 2026
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.
After a chaos/outage window, consecutiveUnavailableException can grow large (e.g. 5+ retries during a 30s partition). Previously the counter only reset after the entire batch completed, so subsequent records in the same batch inherited the high counter and slept for seconds before their first retry — even though CQL was already recovering. In testConnectionFailure this caused the 240s consumer receive timeout to expire before all 3 messages were delivered.
Fix: reset consecutiveUnavailableException to 0 each time a single record's CQL query succeeds in waitForCqlWithRetry (both KafkaCassandraSourceTask and CassandraSource). The end-of-batch reset at poll() is kept as a redundant safety net.