[Transport] possible NPE during shutdown for requests using timeouts

Closes #6849
This commit is contained in:
Boaz Leskes 2014-07-14 10:42:15 +02:00
parent 86bc79202d
commit 8865e60e93
1 changed files with 2 additions and 1 deletions

View File

@ -208,7 +208,8 @@ public class TransportService extends AbstractLifecycleComponent<TransportServic
// usually happen either because we failed to connect to the node // usually happen either because we failed to connect to the node
// or because we failed serializing the message // or because we failed serializing the message
final RequestHolder holderToNotify = clientHandlers.remove(requestId); 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); timeoutHandler.future.cancel(false);
} }