Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-17354

StreamThread::setState race condition causes java.lang.RuntimeException: State mismatch PENDING_SHUTDOWN different from STARTING

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • streams
    • None

    Description

      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

      Attachments

        Activity

          People

            anton.liauchuk Anton Liauchuk
            aoli-al Ao Li
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: