Skip to content

Commit 56b600b

Browse files
authored
Use TaskExecutionTimeTrackingEsThreadPoolExecutor for system writes (#96971)
Relates ES-6248
1 parent 97b7ec9 commit 56b600b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

server/src/main/java/org/elasticsearch/threadpool/ThreadPool.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,14 +234,14 @@ public ThreadPool(final Settings settings, final ExecutorBuilder<?>... customBui
234234
new ScalingExecutorBuilder(Names.FETCH_SHARD_STORE, 1, 2 * allocatedProcessors, TimeValue.timeValueMinutes(5), false)
235235
);
236236
builders.put(Names.SYSTEM_READ, new FixedExecutorBuilder(settings, Names.SYSTEM_READ, halfProcMaxAt5, 2000, false));
237-
builders.put(Names.SYSTEM_WRITE, new FixedExecutorBuilder(settings, Names.SYSTEM_WRITE, halfProcMaxAt5, 1000, false));
237+
builders.put(Names.SYSTEM_WRITE, new FixedExecutorBuilder(settings, Names.SYSTEM_WRITE, halfProcMaxAt5, 1000, true));
238238
builders.put(
239239
Names.SYSTEM_CRITICAL_READ,
240240
new FixedExecutorBuilder(settings, Names.SYSTEM_CRITICAL_READ, halfProcMaxAt5, 2000, false)
241241
);
242242
builders.put(
243243
Names.SYSTEM_CRITICAL_WRITE,
244-
new FixedExecutorBuilder(settings, Names.SYSTEM_CRITICAL_WRITE, halfProcMaxAt5, 1500, false)
244+
new FixedExecutorBuilder(settings, Names.SYSTEM_CRITICAL_WRITE, halfProcMaxAt5, 1500, true)
245245
);
246246

247247
for (final ExecutorBuilder<?> builder : customBuilders) {

server/src/test/java/org/elasticsearch/threadpool/ThreadPoolTests.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,11 @@ public void testWriteThreadPoolUsesTaskExecutionTimeTrackingEsThreadPoolExecutor
355355
final ThreadPool threadPool = new TestThreadPool("test", Settings.EMPTY);
356356
try {
357357
assertThat(threadPool.executor(ThreadPool.Names.WRITE), instanceOf(TaskExecutionTimeTrackingEsThreadPoolExecutor.class));
358+
assertThat(threadPool.executor(ThreadPool.Names.SYSTEM_WRITE), instanceOf(TaskExecutionTimeTrackingEsThreadPoolExecutor.class));
359+
assertThat(
360+
threadPool.executor(ThreadPool.Names.SYSTEM_CRITICAL_WRITE),
361+
instanceOf(TaskExecutionTimeTrackingEsThreadPoolExecutor.class)
362+
);
358363
} finally {
359364
assertTrue(terminate(threadPool));
360365
}

0 commit comments

Comments
 (0)