fix(producer): keep partition muted during handleSuccess retries for non-idempotent producers - #3693
Open
lbcjbb wants to merge 1 commit into
Open
fix(producer): keep partition muted during handleSuccess retries for non-idempotent producers#3693lbcjbb wants to merge 1 commit into
lbcjbb wants to merge 1 commit into
Conversation
…non-idempotent producers PR IBM#3644 changed `handleError()` to use `retryBatch()` for non-idempotent producers, keeping partitions muted during retries. However, `handleSuccess()` was not updated consistently: it called `retryBatch()` with `alreadyMuted=true`, but did not add the partition to `keepMuted`, causing the partition to be unmuted immediately after launching the retry goroutine. This inconsistency could lead to message reordering, as a new batch for the same partition could be sent before the retry completes. This commit aligns `handleSuccess()` with `handleError()` by: - Always populating `keepMuted` for retriable errors (not just for idempotent) - Always calling `RefreshMetadata()` before retries (not just for idempotent) Signed-off-by: Jean-Baptiste Bronisz <jean-baptiste.bronisz@adevinta.com>
puellanivis
reviewed
Jul 30, 2026
puellanivis
left a comment
Collaborator
There was a problem hiding this comment.
I don’t see any issues with the code, but I have no idea about the appropriateness of the logic here.
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.
PR #3644 changed
handleError()to useretryBatch()for non-idempotent producers, keeping partitions muted during retries. However,handleSuccess()was not updated consistently: it calledretryBatch()withalreadyMuted=true, but did not add the partition tokeepMuted, causing the partition to be unmuted immediately after launching the retry goroutine.This inconsistency could lead to message reordering, as a new batch for the same partition could be sent before the retry completes.
This commit aligns
handleSuccess()withhandleError()by:keepMutedfor retriable errors (not just for idempotent)RefreshMetadata()before retries (not just for idempotent)