Lorenz Quack created QPID-7396:
----------------------------------
Summary: [Java Broker] Await actual shutdown of TaskExecutor
Key: QPID-7396
URL: https://issues.apache.org/jira/browse/QPID-7396
Project: Qpid
Issue Type: Bug
Components: Java Broker
Affects Versions: qpid-java-6.1
Reporter: Lorenz Quack
When calling {{TaskExecutorImpl#stop()}} or
{{TaskExecutorImpl#stopImmediately()}} we call {{shutdown()}} or
{{shutdownNow()}} on the underlying {{ExecutorService}}.
According to the
[documentation|https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutorService.html]
these calls do not wait for the actual shutdown to happen. For this one must
call {{ExecutorService#awaitTermination()}} (see example in the documentaion).
I think this could cause a race condition for example in the UserPreference:
* There is a task on the executor when the virtual host is being stopped
* The executor is being shutdown but we do not await the termination
* After the call to {{TaskExecutor#stop()}} we close the PreferenceStore
* The task on the executor could still be executing leading to an
{{IllegalStateException}} in the {{PreferenceStore}} or worse.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]