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
Attachments
Issue Links
- relates to
-
KAFKA-17112 StreamThread shutdown calls completeShutdown only in CREATED state
- Closed
- links to