Преглед на файлове

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 години
родител
ревизия
d8ba92cfa8
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      src/main/java/org/elasticsearch/common/util/concurrent/EsThreadPoolExecutor.java

+ 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