1
0
Эх сурвалжийг харах

Resolve potential deadlock state during EsThreadPoolExecutor shutdown

Fixes #4334

The deadlock occurs between monitor object of EsThreadPoolExecutor and mainLock of ThreadPoolExecutor. The shutdown method of EsThreadPoolExecutor obtains the lock on monitor first and waits for mainLock of ThreadPoolExecutor in ThreadPoolExecutor#shutdown for part of the processing, while EsThreadPoolExecutor#terminated is executed under mainLock and tries to obtain monitor to notify listeners.
Igor Motov 12 жил өмнө
parent
commit
d8ba92cfa8

+ 1 - 1
src/main/java/org/elasticsearch/common/util/concurrent/EsThreadPoolExecutor.java

@@ -53,8 +53,8 @@ public class EsThreadPoolExecutor extends ThreadPoolExecutor {
             } else {
                 this.listener = listener;
             }
-            shutdown();
         }
+        shutdown();
     }
 
     @Override