KAFKA-16630: Fix flaky classic consumer poll test#22787
Merged
Conversation
lianetm
commented
Jul 8, 2026
Comment on lines
-2373
to
-2374
| // TODO: this test references RPCs to be sent that are not part of the CONSUMER group protocol. | ||
| // We are deferring any attempts at generalizing this test for both group protocols to the future. |
Member
Author
There was a problem hiding this comment.
this is an unrelated clean up
AndrewJSchofield
approved these changes
Jul 8, 2026
frankvicky
approved these changes
Jul 9, 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.
Flakiness reproduced locally, due to a single call to poll(0) that may
not be enough if the HB thread interleaves with the application thread.
In the case where HB thread removes the completion handler for the fetch
request from the queue, but before firing it (what puts the records on
the buffer), the app thread reads interleaves, no completed request
found in the queue (so it returns empty on its single poll(0) attempt)
Ensuring there is a following poll will allow to see the records (even
if it was the HB thread taking the completed request from the queue, it
will just fire completion and the next poll after that finds the records
in the buffer).
Same fix applied to 2 tests that had the same check.
Reviewers: Andrew Schofield aschofield@confluent.io, TengYao Chi
frankvicky@apache.org