showuon opened a new pull request #9733: URL: https://github.com/apache/kafka/pull/9733
The PR follows #9688, to make the EosBetaUpgradeIntegrationTest more stable. Fixed some issues: 1. Error message is like: ``` org.apache.kafka.streams.errors.InvalidStateStoreException: Cannot get state store store because the stream thread is PARTITIONS_ASSIGNED, not RUNNING ``` https://ci-builds.apache.org/job/Kafka/job/kafka-trunk-jdk8/274/testReport/org.apache.kafka.streams.integration/EosBetaUpgradeIntegrationTest/shouldUpgradeFromEosAlphaToEosBeta_true_/ After investigation, I found it's because we actually do rebalancing twice after new stream started: 1 for Adding new member, 1 for leader re-joining group during Stable. So, if we only wait for the state to be `RUNNING`, it might enter `REBALANCING` state later, and cause that we can't get store successfully 2. We setUncaughtExceptionHandler, but didn't handle it well. Before, we expected the uncaught exception only got 1, but actually, we'll get 4 here (2 injected exception, 2 injected commit exception). So, we saw many messages in stderr output, which is not good for debugging. After fix, we only output to stderr when the exception is not what we expected for debugging use. ### Committer Checklist (excluded from commit message) - [ ] Verify design and implementation - [ ] Verify test coverage and CI build status - [ ] Verify documentation (including upgrade notes) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org