Skip to content

Commit 7c52b04

Browse files
committed
Iter/feedback
1 parent 4877932 commit 7c52b04

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

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

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import org.elasticsearch.common.util.concurrent.EsRejectedExecutionHandler;
2626
import org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor;
2727
import org.elasticsearch.common.util.concurrent.ThreadContext;
28+
import org.elasticsearch.common.util.concurrent.ThrottledTaskRunner;
2829
import org.elasticsearch.core.Nullable;
2930
import org.elasticsearch.core.TimeValue;
3031
import org.elasticsearch.node.Node;
@@ -74,20 +75,28 @@ public class ThreadPool implements ReportingService<ThreadPoolInfo>, Scheduler,
7475
*/
7576
public static class Names {
7677
/**
77-
* A thread pool with a very high (but finite) maximum size for when there really is no other choice.
78+
* A thread pool with a very high (but finite) maximum size for use when there really is no other choice.
7879
* <p>
7980
* This pool may be used for one-off CPU-bound activities, but the maximum size is so high that it doesn't really work well to do a
80-
* lot of CPU-bound work in parallel here. Likewise you can do IO on this pool, but using it for lots of concurrent IO is likely
81-
* harmful in clusters with poor concurrent IO performance (especially if using spinning disks). Blocking on a future on this pool
81+
* lot of CPU-bound work in parallel here: submitting more CPU-bound tasks than we have CPUs to run them will burn a lot of CPU just
82+
* context-switching in order to try and make fair progress on all the tasks at once. Better to submit fewer tasks and wait for them
83+
* to complete before submitting more. See {@link ThrottledTaskRunner} and friends for utilities to help with this.
84+
* <p>
85+
* Likewise you can do IO on this pool, but using it for lots of concurrent IO is likely
86+
* harmful in clusters with poor concurrent IO performance (especially if using spinning disks).
87+
* <p>
88+
* Blocking on a future on this pool
8289
* risks deadlock if there's a chance that the completion of the future depends on work being done on this pool. Unfortunately
8390
* that's pretty likely in most cases because of how often this pool is used; it's really rare because of the high limit on the pool
84-
* size, but when it happens it is extremely harmful to the node.
91+
* size, but when it happens it is extremely harmful to the node.
8592
* <p>
8693
* This pool is also used for recovery-related work. The recovery subsystem bounds its own concurrency, and therefore the amount of
8794
* recovery work done on the {@code #GENERIC} pool, via {@code cluster.routing.allocation.node_concurrent_recoveries} and related
8895
* settings.
8996
* <p>
90-
* This pool does not reject any task. If you submit a task after the pool starts to shut down, it may simply never run.
97+
* Other subsystems
98+
* <p>
99+
* This pool does not reject any task. Tasks you submit to this executor after the pool starts to shut down may simply never run.
91100
*/
92101
public static final String GENERIC = "generic";
93102

0 commit comments

Comments
 (0)