From 247d7c7e89e9dde6429ceacd45d174c17d4037bd Mon Sep 17 00:00:00 2001 From: Henning Andersen Date: Thu, 8 Aug 2024 12:34:29 +0200 Subject: [PATCH] Rename allowedExecutors args --- .../elasticsearch/action/support/PlainActionFuture.java | 8 ++++---- .../action/support/UnsafePlainActionFuture.java | 8 ++++---- .../action/support/TestPlainActionFuture.java | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) 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 ee4433369f689..30bdb7fd2c4cb 100644 --- a/server/src/main/java/org/elasticsearch/action/support/PlainActionFuture.java +++ b/server/src/main/java/org/elasticsearch/action/support/PlainActionFuture.java @@ -381,12 +381,12 @@ private boolean assertCompleteAllowed() { } // only used in assertions - boolean allowedExecutors(Thread thread1, Thread thread2) { + 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 thread1 != thread2 : "only call this for different threads"; - String thread1Name = EsExecutors.executorName(thread1); - String thread2Name = EsExecutors.executorName(thread2); + 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; } } diff --git a/server/src/main/java/org/elasticsearch/action/support/UnsafePlainActionFuture.java b/server/src/main/java/org/elasticsearch/action/support/UnsafePlainActionFuture.java index 332b046c9099f..dfbd4f2b1801a 100644 --- a/server/src/main/java/org/elasticsearch/action/support/UnsafePlainActionFuture.java +++ b/server/src/main/java/org/elasticsearch/action/support/UnsafePlainActionFuture.java @@ -45,9 +45,9 @@ public UnsafePlainActionFuture(String unsafeExecutor, String unsafeExecutor2) { } @Override - boolean allowedExecutors(Thread thread1, Thread thread2) { - return super.allowedExecutors(thread1, thread2) - || unsafeExecutor.equals(EsExecutors.executorName(thread1)) - || unsafeExecutor2.equals(EsExecutors.executorName(thread1)); + boolean allowedExecutors(Thread blockedThread, Thread completingThread) { + return super.allowedExecutors(blockedThread, completingThread) + || unsafeExecutor.equals(EsExecutors.executorName(blockedThread)) + || unsafeExecutor2.equals(EsExecutors.executorName(blockedThread)); } } diff --git a/test/framework/src/main/java/org/elasticsearch/action/support/TestPlainActionFuture.java b/test/framework/src/main/java/org/elasticsearch/action/support/TestPlainActionFuture.java index 0264920c9d017..e6729a20d93e3 100644 --- a/test/framework/src/main/java/org/elasticsearch/action/support/TestPlainActionFuture.java +++ b/test/framework/src/main/java/org/elasticsearch/action/support/TestPlainActionFuture.java @@ -13,7 +13,7 @@ */ public class TestPlainActionFuture extends PlainActionFuture { @Override - boolean allowedExecutors(Thread thread1, Thread thread2) { + boolean allowedExecutors(Thread blockedThread, Thread completingThread) { return true; } }