[ 
https://issues.apache.org/jira/browse/KAFKA-17114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17914282#comment-17914282
 ] 

Ao Li commented on KAFKA-17114:
-------------------------------

[~mjsax] Thanks for confirming this!

Sorry for not catching the changes. My previous comment was made on Oct 28, and 
I rebased my patch into the trunk that day. The bug was actually fixed on Dec 
18 (https://github.com/apache/kafka/pull/18253) based on the public GitHub 
record. I'm unsure if you have any internal Kafka fork; therefore, I didn't see 
the fix. 

It was a bit hard to keep track of the changes in the trunk, but I'll keep my 
eyes on them periodically. 


> DefaultStateUpdater::handleRuntimeException should update isRunning before 
> calling `addToExceptionsAndFailedTasksThenClearUpdatingAndPausedTasks`
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-17114
>                 URL: https://issues.apache.org/jira/browse/KAFKA-17114
>             Project: Kafka
>          Issue Type: Test
>          Components: streams, unit tests
>    Affects Versions: 3.9.0
>            Reporter: Ao Li
>            Priority: Minor
>             Fix For: 4.1.0
>
>
> I saw a flaky test in 
> DefaultStateUpdaterTest::shouldThrowIfAddingStandbyAndActiveTaskWithSameId 
> recently.
> {code}
> org.opentest4j.AssertionFailedError: expected: <false> but was: <true>
>       at 
> org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
>       at 
> org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
>       at org.junit.jupiter.api.AssertFalse.failNotFalse(AssertFalse.java:63)
>       at org.junit.jupiter.api.AssertFalse.assertFalse(AssertFalse.java:36)
>       at org.junit.jupiter.api.AssertFalse.assertFalse(AssertFalse.java:31)
>       at org.junit.jupiter.api.Assertions.assertFalse(Assertions.java:231)
>       at 
> org.apache.kafka.streams.processor.internals.DefaultStateUpdaterTest.shouldThrowIfAddingTasksWithSameId(DefaultStateUpdaterTest.java:294)
>       at 
> org.apache.kafka.streams.processor.internals.DefaultStateUpdaterTest.shouldThrowIfAddingStandbyAndActiveTaskWithSameId(DefaultStateUpdaterTest.java:285)
>       at java.base/java.lang.reflect.Method.invoke(Method.java:580)
>       at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
>       at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
> {code}
> To make the bug more reproducible, you may add `Thread.sleep(5)` after 
> `addToExceptionsAndFailedTasksThenClearUpdatingAndPausedTasks(runtimeException);`
>  in  DefaultStateUpdater::handleRuntimeException
> The test is flaky because             
> `addToExceptionsAndFailedTasksThenClearUpdatingAndPausedTasks(runtimeException);`
>  will unblock the `verifyFailedTasks(IllegalStateException.class, task1);` 
> statement in DefaultStateUpdaterTest::shouldThrowIfAddingTasksWithSameId. 
> If `assertFalse(stateUpdater.isRunning());` is executed before 
> `isRunning.set(false);` the test will fail



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to