MINOR: Fix race conditions in KafkaStreams when topic is missing.#20362
MINOR: Fix race conditions in KafkaStreams when topic is missing.#20362chickenchickenlove wants to merge 1 commit intoapache:trunkfrom
Conversation
|
@mjsax sorry to mention. |
|
A label of 'needs-attention' was automatically added to this PR in order to raise the |
|
I’d greatly appreciate it if someone could kindly review this PR when they have a chance. |
|
A label of 'needs-attention' was automatically added to this PR in order to raise the |
|
Gently Ping, could you take a look this PR? |
|
A label of 'needs-attention' was automatically added to this PR in order to raise the |
|
We are somewhat swamped recently. Sorry for the delay... Don't know when I will get to it. But please keeping nagging us about it :) |
|
@mjsax Thanks for your comment even if you are in busy! |
|
A label of 'needs-attention' was automatically added to this PR in order to raise the |
|
Hey @chickenchickenlove , thanks for looking in to this, interesting. Help me understand this issue better (the proposed change is harmless as I see it and could fix the flakiness, but want to make sure it is not hiding something else). High level, from the consumer POV, the 2 sides involved happen in the background (so safe there):
So how exactly do we end up in step 8??? Is it that the partitions passed to the unsubscribe here (taken from the This bit it different between streams and the consumer mgrs actually (the partitions to revoked passed in the consumer are taken directly from the subscriptionState, not from the currentAssignment like the streamsMgr does) |
|
@lianetm , Thanks for your feedback! I have a question. |
yes, I have no concern with the fix really, I just don't fully understand the issue (want us to make sure we're not covering an issue with the assignment passed to the task revocation) Thanks for looking into it! |
|
I see! |
|
It looks like a commit masked the issue I was trying to fix.
In this branch, I reverted this PR(38e3359) to check However, If I tested it based on 986322d, In other words, one of the PRs between those two commits made the That is, it succeeds under the legacy protocol but fails under the new protocol. Is this the expected behavior for the new protocol in Kafka Streams? |
|
@lianetm
In my local, timer set the value `maxPollTimeMs` (300000ms).
If I set the timer as `1000`ms, same problem occur and this patch will work.
So I believe this change is masking the issue. So, Please let me know your opinion! FYI, |
|
There was happening 😅 In summary,
So, Let me dig into more. |
|
This PR is being marked as stale since it has not had any activity in 90 days. If you If you are having difficulty finding a reviewer, please reach out on the [mailing list](https://kafka.apache.org/contact). If this PR is no longer valid or desired, please feel free to close it. If no activity occurs in the next 30 days, it will be automatically closed. |
|
This PR has been closed since it has not had any activity in 120 days. If you feel like this |


Background
There is race condition in

ConsumerNetworkThreadforKafka Streamswithnew_protocol.So it make HandlingSourceTopicDeletionIntegrationTest#shouldThrowErrorAfterSourceTopicDeleted be flaky.
Please refer to details in attached sequence diagram.
CC. @mjsax
Result
HandlingSourceTopicDeletionIntegrationTest#shouldThrowErrorAfterSourceTopicDeleted.Related