diff --git a/server/src/main/java/org/elasticsearch/action/support/PlainActionFuture.java b/server/src/main/java/org/elasticsearch/action/support/PlainActionFuture.java index 30bdb7fd2c4cb..4022ef3873771 100644 --- a/server/src/main/java/org/elasticsearch/action/support/PlainActionFuture.java +++ b/server/src/main/java/org/elasticsearch/action/support/PlainActionFuture.java @@ -385,8 +385,8 @@ boolean allowedExecutors(Thread blockedThread, Thread completingThread) { // this should only be used to validate thread interactions, like not waiting for a future completed on the same // executor, hence calling it with the same thread indicates a bug in the assertion using this. assert blockedThread != completingThread : "only call this for different threads"; - String thread1Name = EsExecutors.executorName(blockedThread); - String thread2Name = EsExecutors.executorName(completingThread); - return thread1Name == null || thread2Name == null || thread1Name.equals(thread2Name) == false; + String blockedThreadName = EsExecutors.executorName(blockedThread); + String completingThreadName = EsExecutors.executorName(completingThread); + return blockedThreadName == null || completingThreadName == null || blockedThreadName.equals(completingThreadName) == false; } }