[ https://issues.apache.org/jira/browse/KAFKA-17354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17939350#comment-17939350 ]
Ao Li edited comment on KAFKA-17354 at 3/28/25 11:49 PM: --------------------------------------------------------- We recently released the Fray Gradle plugin(https://github.com/cmu-pasta/fray?tab=readme-ov-file#gradle), which allows developers to use Fray easily. I added the Fray debugger to PR/18675 and ran the test using Fray, but I still saw the failure. You may find how I did this here: https://github.com/aoli-al/kafka/tree/KAFKA-17379 and this commit https://github.com/aoli-al/kafka/commit/990469f8597799114103c50ff5a741de0dcaee7c Our extension still has some limitations, such as missing support of @ParameterizedTest or timed operations. So it requires a few code changes to the existing tests. was (Author: JIRAUSER306156): We recently released the Fray Gradle plugin(https://github.com/cmu-pasta/fray?tab=readme-ov-file#gradle), which allows developers to use Fray easily. I added the Fray debugger to PR/18675 and ran the test using Fray, but I still saw the failure. You may find how I did this here: https://github.com/aoli-al/kafka/tree/KAFKA-17379 and this commit https://github.com/aoli-al/kafka/commit/bdf4033b67cc7e65bc9b44f846e8cd38d2256c60 Our extension still has some limitations, such as missing support of @ParameterizedTest or timed operations. So it requires a few code changes to the existing tests. > StreamThread::setState race condition causes java.lang.RuntimeException: > State mismatch PENDING_SHUTDOWN different from STARTING > -------------------------------------------------------------------------------------------------------------------------------- > > Key: KAFKA-17354 > URL: https://issues.apache.org/jira/browse/KAFKA-17354 > Project: Kafka > Issue Type: Bug > Components: streams > Reporter: Ao Li > Assignee: Anton Liauchuk > Priority: Major > > I saw a test failure in `StreamThreadTest::shouldChangeStateAtStartClose`. A > race condition in `setState` causes an uncaught exception thrown in > `StateListenerStub`. > Basically, the function `setState` allows two threads to call > `stateListener.onChange` concurrently. > This patch will help you to reproduce the failure deterministically. > https://github.com/aoli-al/kafka/commit/033a9a33766740e6843effb9beabfdcb3804846b -- This message was sent by Atlassian Jira (v8.20.10#820010)