Nicholas Telford created KAFKA-17432:
----------------------------------------
Summary: DefaultStateUpdater/DefaultTaskExecutor shutdown returns
before threads have fully exited
Key: KAFKA-17432
URL: https://issues.apache.org/jira/browse/KAFKA-17432
Project: Kafka
Issue Type: Bug
Components: streams
Affects Versions: 4.0.0
Reporter: Nicholas Telford
Assignee: Nicholas Telford
{{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.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)