KAFKA-20423: Fix flakiness of testWakeupWithFetchDataAvailable#22364
Open
chickenchickenlove wants to merge 2 commits into
Open
KAFKA-20423: Fix flakiness of testWakeupWithFetchDataAvailable#22364chickenchickenlove wants to merge 2 commits into
chickenchickenlove wants to merge 2 commits into
Conversation
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
I didn't reproduce it in my local.
This PR is based on the specific assumptions and fix non-deterministic path caused by it.
MockClient.responsesviarespondFrom(...).MockClient.poll()first.responses.poll().response.onComplete().client.poll(0, ...), but since the response queue is empty, it completes nothing and returns.consumer.wakeup()is called.consumer.poll(Duration.ZERO)immediately throwsWakeupExceptionfrommaybeTriggerWakeup().consumer.position(tp0)already has a valid position of 0, so it returns 0 directly without performing a network poll.consumer.poll(Duration.ZERO)also returns empty because the response is not yet inpendingCompletionand not in theFetchBuffereither.response.onComplete(), but by then the assertion has alreadyfailed.
Although I didn't reproduce it in my local, this scenario make sense to me.
Given this, this PR applies the change, and I plan to monitor the CI trend afterward to confirm whether the flakiness is resolved.