Skip to content

Commit 19fc291

Browse files
committed
Revert "Make sure blocked task is dequeued before refreshing cluster info"
This reverts commit 075be86.
1 parent 075be86 commit 19fc291

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

server/src/internalClusterTest/java/org/elasticsearch/cluster/routing/allocation/decider/WriteLoadConstraintDeciderIT.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -285,20 +285,15 @@ public void testMaxQueueLatencyMetricIsPublished() {
285285
final String dataNodeToDelay = randomFrom(dataNodes);
286286
final ThreadPool threadPoolToDelay = internalCluster().getInstance(ThreadPool.class, dataNodeToDelay);
287287

288-
// Fill the write thread pool
288+
// Fill the write thread pool and block a task for some time
289289
final int writeThreadPoolSize = threadPoolToDelay.info(ThreadPool.Names.WRITE).getMax();
290290
final var latch = new CountDownLatch(1);
291291
final var writeThreadPool = threadPoolToDelay.executor(ThreadPool.Names.WRITE);
292-
range(0, writeThreadPoolSize).forEach(i -> writeThreadPool.execute(() -> safeAwait(latch)));
293-
// Submit a task that will be blocked
294-
final var blockedTask = writeThreadPool.submit(() -> {
295-
// Doesnt need to do anything
296-
});
292+
range(0, writeThreadPoolSize + 1).forEach(i -> writeThreadPool.execute(() -> safeAwait(latch)));
297293
final long delayMillis = randomIntBetween(100, 200);
298294
safeSleep(delayMillis);
299295
// Unblock the pool
300296
latch.countDown();
301-
safeGet(blockedTask);
302297

303298
refreshClusterInfo(masterName);
304299
mostRecentQueueLatencyMetrics = getMostRecentQueueLatencyMetrics(dataNodes);

0 commit comments

Comments
 (0)