A taskExecutor thread could deadlock in getTaskExector() if stop() is attempting to shut down the task executor. This could delay the stop by up to 20 seconds. Move the if(isActive) test outside of the synchronized block.
A taskExecutor thread could deadlock in getTaskExector() if stop() is attempting to shut down the task executor. This could delay the stop by up to 20 seconds. Move the if(isActive) test outside of the synchronized block.