From 0e766dc5b5685fd3511a2f9374ed3538fcbc7ce9 Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Thu, 10 Oct 2024 20:23:09 +1100 Subject: [PATCH] fix one future completion error --- .../main/java/org/elasticsearch/transport/TransportService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/org/elasticsearch/transport/TransportService.java b/server/src/main/java/org/elasticsearch/transport/TransportService.java index 27db078788506..9cd46fa577bf6 100644 --- a/server/src/main/java/org/elasticsearch/transport/TransportService.java +++ b/server/src/main/java/org/elasticsearch/transport/TransportService.java @@ -1059,7 +1059,7 @@ private Executor getInternalSendExceptionExecutor(Executor handlerExecutor) { if (lifecycle.stoppedOrClosed()) { // too late to try and dispatch anywhere else, let's just use the calling thread return EsExecutors.DIRECT_EXECUTOR_SERVICE; - } else if (handlerExecutor == EsExecutors.DIRECT_EXECUTOR_SERVICE) { + } else if (handlerExecutor == EsExecutors.DIRECT_EXECUTOR_SERVICE && enableStackOverflowAvoidance) { // if the handler is non-forking then dispatch to GENERIC to avoid a possible stack overflow return threadPool.generic(); } else {