diff --git a/docs/reference/migration/migrate_7_7.asciidoc b/docs/reference/migration/migrate_7_7.asciidoc index b57e52beb1d..9aa971f7dd5 100644 --- a/docs/reference/migration/migrate_7_7.asciidoc +++ b/docs/reference/migration/migrate_7_7.asciidoc @@ -65,3 +65,10 @@ for `gt` and `lte` boundaries, the same queries on `date_range` fields didn't do this. The behavior is now the same for both field types like documented in <>. +[float] +==== `thread_pool.listener.size` and `thread_pool.listener.queue_size` have been deprecated + +The listener thread pool is no longer used internally by Elasticsearch. +Therefore, these settings have been deprecated. You can safely remove these +settings from the configuration of your nodes. + diff --git a/server/src/main/java/org/elasticsearch/threadpool/FixedExecutorBuilder.java b/server/src/main/java/org/elasticsearch/threadpool/FixedExecutorBuilder.java index 43da1044c6b..3be4d56b1bb 100644 --- a/server/src/main/java/org/elasticsearch/threadpool/FixedExecutorBuilder.java +++ b/server/src/main/java/org/elasticsearch/threadpool/FixedExecutorBuilder.java @@ -49,7 +49,26 @@ public final class FixedExecutorBuilder extends ExecutorBuilder( - sizeKey, - s -> Integer.toString(size), - s -> Setting.parseInt(s, 1, applyHardSizeLimit(settings, name), sizeKey), - Setting.Property.NodeScope); + new Setting<>( + sizeKey, + s -> Integer.toString(size), + s -> Setting.parseInt(s, 1, applyHardSizeLimit(settings, name), sizeKey), + properties); final String queueSizeKey = settingsKey(prefix, "queue_size"); - this.queueSizeSetting = Setting.intSetting(queueSizeKey, queueSize, Setting.Property.NodeScope); + this.queueSizeSetting = Setting.intSetting(queueSizeKey, queueSize, properties); } @Override diff --git a/server/src/main/java/org/elasticsearch/threadpool/ThreadPool.java b/server/src/main/java/org/elasticsearch/threadpool/ThreadPool.java index 323bbdea6f2..242c0b1f99e 100644 --- a/server/src/main/java/org/elasticsearch/threadpool/ThreadPool.java +++ b/server/src/main/java/org/elasticsearch/threadpool/ThreadPool.java @@ -66,7 +66,7 @@ public class ThreadPool implements Scheduler { public static class Names { public static final String SAME = "same"; public static final String GENERIC = "generic"; - public static final String LISTENER = "listener"; + @Deprecated public static final String LISTENER = "listener"; public static final String GET = "get"; public static final String ANALYZE = "analyze"; public static final String WRITE = "write"; @@ -181,7 +181,7 @@ public class ThreadPool implements Scheduler { builders.put(Names.MANAGEMENT, new ScalingExecutorBuilder(Names.MANAGEMENT, 1, 5, TimeValue.timeValueMinutes(5))); // no queue as this means clients will need to handle rejections on listener queue even if the operation succeeded // the assumption here is that the listeners should be very lightweight on the listeners side - builders.put(Names.LISTENER, new FixedExecutorBuilder(settings, Names.LISTENER, halfProcMaxAt10, -1)); + builders.put(Names.LISTENER, new FixedExecutorBuilder(settings, Names.LISTENER, halfProcMaxAt10, -1, true)); builders.put(Names.FLUSH, new ScalingExecutorBuilder(Names.FLUSH, 1, halfProcMaxAt5, TimeValue.timeValueMinutes(5))); builders.put(Names.REFRESH, new ScalingExecutorBuilder(Names.REFRESH, 1, halfProcMaxAt10, TimeValue.timeValueMinutes(5))); builders.put(Names.WARMER, new ScalingExecutorBuilder(Names.WARMER, 1, halfProcMaxAt5, TimeValue.timeValueMinutes(5))); diff --git a/server/src/test/java/org/elasticsearch/threadpool/FixedThreadPoolTests.java b/server/src/test/java/org/elasticsearch/threadpool/FixedThreadPoolTests.java index 5ec0f30f520..f31e4bdaef1 100644 --- a/server/src/test/java/org/elasticsearch/threadpool/FixedThreadPoolTests.java +++ b/server/src/test/java/org/elasticsearch/threadpool/FixedThreadPoolTests.java @@ -22,6 +22,7 @@ package org.elasticsearch.threadpool; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.EsExecutors; import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; +import org.elasticsearch.threadpool.ThreadPool.Names; import java.util.concurrent.CountDownLatch; @@ -88,6 +89,10 @@ public class FixedThreadPoolTests extends ESThreadPoolTestCase { } finally { terminateThreadPoolIfNeeded(threadPool); } + + if (Names.LISTENER.equals(threadPoolName)) { + assertSettingDeprecationsAndWarnings(new String[]{"thread_pool.listener.queue_size", "thread_pool.listener.size"}); + } } } diff --git a/server/src/test/java/org/elasticsearch/threadpool/UpdateThreadPoolSettingsTests.java b/server/src/test/java/org/elasticsearch/threadpool/UpdateThreadPoolSettingsTests.java index c004ed9b3bc..537d39dd9d2 100644 --- a/server/src/test/java/org/elasticsearch/threadpool/UpdateThreadPoolSettingsTests.java +++ b/server/src/test/java/org/elasticsearch/threadpool/UpdateThreadPoolSettingsTests.java @@ -118,6 +118,10 @@ public class UpdateThreadPoolSettingsTests extends ESThreadPoolTestCase { } finally { terminateThreadPoolIfNeeded(threadPool); } + + if (Names.LISTENER.equals(threadPoolName)) { + assertSettingDeprecationsAndWarnings(new String[]{"thread_pool.listener.size"}); + } } public void testScalingExecutorType() throws InterruptedException { @@ -173,6 +177,10 @@ public class UpdateThreadPoolSettingsTests extends ESThreadPoolTestCase { } finally { terminateThreadPoolIfNeeded(threadPool); } + + if (Names.LISTENER.equals(threadPoolName)) { + assertSettingDeprecationsAndWarnings(new String[]{"thread_pool.listener.queue_size"}); + } } public void testCustomThreadPool() throws Exception {