Skip to content

Commit d76358c

Browse files
authored
Deprecate fixed_auto_queue_size thread pool type (#52399)
Relates #52280
1 parent 087ceb8 commit d76358c

File tree

3 files changed

+28
-16
lines changed

3 files changed

+28
-16
lines changed

docs/reference/modules/threadpool.asciidoc

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ There are several thread pools, but the important ones include:
2020
`1000`.
2121

2222
[[search-throttled]]`search_throttled`::
23-
For count/search/suggest/get operations on `search_throttled indices`.
24-
Thread pool type is `fixed_auto_queue_size` with a size of `1`, and initial
23+
For count/search/suggest/get operations on `search_throttled indices`.
24+
Thread pool type is `fixed_auto_queue_size` with a size of `1`, and initial
2525
queue_size of `100`.
2626

2727
`get`::
@@ -30,7 +30,7 @@ There are several thread pools, but the important ones include:
3030
queue_size of `1000`.
3131

3232
`analyze`::
33-
For analyze requests. Thread pool type is `fixed` with a size of `1`, queue
33+
For analyze requests. Thread pool type is `fixed` with a size of `1`, queue
3434
size of `16`.
3535

3636
`write`::
@@ -51,8 +51,8 @@ There are several thread pools, but the important ones include:
5151
keep-alive of `5m` and a max of `min(10, (# of available processors)/2)`.
5252

5353
`listener`::
54-
Mainly for java client executing of action when listener threaded is set to
55-
`true`. Thread pool type is `scaling` with a default max of
54+
Mainly for java client executing of action when listener threaded is set to
55+
`true`. Thread pool type is `scaling` with a default max of
5656
`min(10, (# of available processors)/2)`.
5757

5858
`fetch_shard_started`::
@@ -125,6 +125,9 @@ thread_pool:
125125

126126
experimental[]
127127

128+
deprecated[7.7.0,The experimental `fixed_auto_queue_size` thread pool type is
129+
deprecated and will be removed in 8.0.]
130+
128131
The `fixed_auto_queue_size` thread pool holds a fixed size of threads to handle
129132
the requests with a bounded queue for pending requests that have no threads to
130133
service them. It's similar to the `fixed` threadpool, however, the `queue_size`
@@ -202,13 +205,13 @@ processors: 2
202205
There are a few use-cases for explicitly overriding the `processors`
203206
setting:
204207

205-
. If you are running multiple instances of {es} on the same host but want {es}
206-
to size its thread pools as if it only has a fraction of the CPU, you should
207-
override the `processors` setting to the desired fraction, for example, if
208+
. If you are running multiple instances of {es} on the same host but want {es}
209+
to size its thread pools as if it only has a fraction of the CPU, you should
210+
override the `processors` setting to the desired fraction, for example, if
208211
you're running two instances of {es} on a 16-core machine, set `processors` to 8.
209-
Note that this is an expert-level use case and there's a lot more involved
210-
than just setting the `processors` setting as there are other considerations
211-
like changing the number of garbage collector threads, pinning processes to
212+
Note that this is an expert-level use case and there's a lot more involved
213+
than just setting the `processors` setting as there are other considerations
214+
like changing the number of garbage collector threads, pinning processes to
212215
cores, and so on.
213216
. Sometimes the number of processors is wrongly detected and in such
214217
cases explicitly setting the `processors` setting will workaround such

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,13 @@ public final class AutoQueueAdjustingExecutorBuilder extends ExecutorBuilder<Aut
6767
final String frameSizeKey = settingsKey(prefix, "auto_queue_frame_size");
6868
final String targetedResponseTimeKey = settingsKey(prefix, "target_response_time");
6969
this.targetedResponseTimeSetting = Setting.timeSetting(targetedResponseTimeKey, TimeValue.timeValueSeconds(1),
70-
TimeValue.timeValueMillis(10), Setting.Property.NodeScope);
70+
TimeValue.timeValueMillis(10), Setting.Property.NodeScope, Setting.Property.Deprecated);
7171
this.queueSizeSetting = Setting.intSetting(queueSizeKey, initialQueueSize, Setting.Property.NodeScope);
7272
// These temp settings are used to validate the min and max settings below
73-
Setting<Integer> tempMaxQueueSizeSetting = Setting.intSetting(maxSizeKey, maxQueueSize, Setting.Property.NodeScope);
74-
Setting<Integer> tempMinQueueSizeSetting = Setting.intSetting(minSizeKey, minQueueSize, Setting.Property.NodeScope);
73+
Setting<Integer> tempMaxQueueSizeSetting = Setting.intSetting(maxSizeKey, maxQueueSize, Setting.Property.NodeScope,
74+
Setting.Property.Deprecated);
75+
Setting<Integer> tempMinQueueSizeSetting = Setting.intSetting(minSizeKey, minQueueSize, Setting.Property.NodeScope,
76+
Setting.Property.Deprecated);
7577

7678
this.minQueueSizeSetting = new Setting<>(
7779
minSizeKey,
@@ -126,8 +128,9 @@ public Iterator<Setting<?>> settings() {
126128
}
127129

128130
},
129-
Setting.Property.NodeScope);
130-
this.frameSizeSetting = Setting.intSetting(frameSizeKey, frameSize, 100, Setting.Property.NodeScope);
131+
Setting.Property.NodeScope, Setting.Property.Deprecated);
132+
this.frameSizeSetting = Setting.intSetting(frameSizeKey, frameSize, 100, Setting.Property.NodeScope, Setting.Property.Deprecated,
133+
Setting.Property.Deprecated);
131134
}
132135

133136
@Override

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ public void testValidatingMinMaxSettings() {
7878
} catch (IllegalArgumentException e) {
7979
assertEquals(e.getMessage(), "Failed to parse value [100] for setting [thread_pool.test.min_queue_size] must be <= 99");
8080
}
81+
82+
assertSettingDeprecationsAndWarnings(new String[]{"thread_pool.test.max_queue_size"});
8183
}
8284

8385
public void testSetLowerSettings() {
@@ -89,6 +91,8 @@ public void testSetLowerSettings() {
8991
AutoQueueAdjustingExecutorBuilder.AutoExecutorSettings s = test.getSettings(settings);
9092
assertEquals(10, s.maxQueueSize);
9193
assertEquals(10, s.minQueueSize);
94+
95+
assertSettingDeprecationsAndWarnings(new String[]{"thread_pool.test.min_queue_size", "thread_pool.test.max_queue_size"});
9296
}
9397

9498
public void testSetHigherSettings() {
@@ -100,6 +104,8 @@ public void testSetHigherSettings() {
100104
AutoQueueAdjustingExecutorBuilder.AutoExecutorSettings s = test.getSettings(settings);
101105
assertEquals(3000, s.maxQueueSize);
102106
assertEquals(2000, s.minQueueSize);
107+
108+
assertSettingDeprecationsAndWarnings(new String[]{"thread_pool.test.min_queue_size", "thread_pool.test.max_queue_size"});
103109
}
104110

105111
}

0 commit comments

Comments
 (0)