During worker reconnection it submits in assignmentUpdatesExecutor creation of listener to assigned zk tree. After creation it blocks the thread until CuratorCache will be initialized (Worker#addListenerToAssignedTree).
If DJM close method will be invoked before CuratorCache will be initialized, CuratorCache will never be initialized, therefore awaiting initialization will block the thread until force shutdown. Force shutdown will be invoked in DJM close method only after waiting timeToWaitTermination timeout.
During worker reconnection it submits in assignmentUpdatesExecutor creation of listener to assigned zk tree. After creation it blocks the thread until CuratorCache will be initialized (Worker#addListenerToAssignedTree).
If DJM close method will be invoked before CuratorCache will be initialized, CuratorCache will never be initialized, therefore awaiting initialization will block the thread until force shutdown. Force shutdown will be invoked in DJM close method only after waiting timeToWaitTermination timeout.