浏览代码

[Transport] possible NPE during shutdown for requests using timeouts

Closes #6849
Boaz Leskes 11 年之前
父节点
当前提交
8865e60e93
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/main/java/org/elasticsearch/transport/TransportService.java

+ 2 - 1
src/main/java/org/elasticsearch/transport/TransportService.java

@@ -208,7 +208,8 @@ public class TransportService extends AbstractLifecycleComponent<TransportServic
             // usually happen either because we failed to connect to the node
             // or because we failed serializing the message
             final RequestHolder holderToNotify = clientHandlers.remove(requestId);
-            if (timeoutHandler != null) {
+            // if the scheduler raise a EsRejectedExecutionException (due to shutdown), we may have a timeout handler, but no future
+            if (timeoutHandler != null && timeoutHandler.future != null) {
                 timeoutHandler.future.cancel(false);
             }