Details
-
Bug
-
Status: Review In Progress
-
Normal
-
Resolution: Unresolved
-
None
-
None
-
Code
-
Low
-
Normal
-
Unit Test
-
All
-
None
-
Description
SharedExecutorPool.shutdownAndWait calls shutdownNow on the executors it owns, which has the side effect of removing the executor from the list, then uses the same emptied list to try and wait for them to complete shutting down, which completes immediately.
Once fixed by copying the list in SEP.shutdownAndWait, the SEPExecutorTest suite fails with a timeout due to a startup race in SEPWorker.
If a SEPExecutor is shutdown immediately after maybeSchedule creates a new SEPWorker,
but before it is able to execute the first task then it exits immediately on entering the work loop with a work and task permit reserved for it, which invalidates the work/task permit accounting and prevents calling the shutdown SimpleCondition.signalAll when the last SEPWorker exits.