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

DefaultStateUpdater/DefaultTaskExecutor shutdown returns before threads have fully exited

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 4.0.0
    • 4.0.0
    • streams
    • None

    Description

      DefaultStateUpdater and DefaultTaskExecutor each provide a shutdown method, that shuts down the respective thread.

      This method returns before the thread has completely shutdown. This can cause some issues in tests, most notably StreamThreadTest, which now checks that there are no running StateUpdater or TaskExecutor threads in the test tearDown, immediately after shutting the threads down.

      This occurs because we use a CountDownLatch to await the shutdown of these threads, however, this is triggered before the thread has fully exited. Consequently, StreamThreadTest sometimes observes one of these threads after they have been shutdown (usually in the middle of printing the "Thread shutdown" log message, or even executing the Thread#exit JVM method) and fails the test.

      Attachments

        Issue Links

          Activity

            People

              nicktelford Nicholas Telford
              nicktelford Nicholas Telford
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: