Ao Li created KAFKA-17394:
-----------------------------

             Summary: Flaky test in 
DefaultTaskExecutorTest.shouldSetUncaughtStreamsException
                 Key: KAFKA-17394
                 URL: https://issues.apache.org/jira/browse/KAFKA-17394
             Project: Kafka
          Issue Type: Bug
            Reporter: Ao Li


Another flaky test caused by non-atomic operation in DefaultTaskExecutor. 
Please use https://github.com/aoli-al/kafka/tree/KAFKA-249 this fork to 
reproduce the failure.  Command:  ./gradlew :streams:test --tests 
DefaultTaskExecutorTest.shouldSetUncaughtStreamsException

Exception: 

{code}
org.opentest4j.AssertionFailedError: expected: <null> but was: 
<org.apache.kafka.streams.processor.internals.ReadOnlyTask@1e469dfd>
        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.AssertNull.failNotNull(AssertNull.java:50)
        at org.junit.jupiter.api.AssertNull.assertNull(AssertNull.java:35)
        at org.junit.jupiter.api.AssertNull.assertNull(AssertNull.java:30)
        at org.junit.jupiter.api.Assertions.assertNull(Assertions.java:279)
        at 
org.apache.kafka.streams.processor.internals.tasks.DefaultTaskExecutorTest.shouldSetUncaughtStreamsException(DefaultTaskExecutorTest.java:254)
        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}

The root cause is that the operation in DefaultTaskExecutor:unassignCurrentTask 
is not atomic: 

{code}
            // This operation unblocks the verify statement in test
            taskManager.unassignTask(currentTask, DefaultTaskExecutor.this); 

            final StreamTask retTask = currentTask;
            // This operation sets the currentTask to null. 
            currentTask = null;
{code}



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

Reply via email to