Skip to content

Commit 7cc5afd

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

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

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

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,26 +75,25 @@ public class ThreadPool implements ReportingService<ThreadPoolInfo>, Scheduler,
7575
*/
7676
public static class Names {
7777
/**
78-
* A thread pool with a very high (but finite) maximum size for use when there really is no other choice.
78+
* A thread pool with a very high (but finite) maximum size. Use only after careful consideration.
7979
* <p>
80-
* 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+
* This pool may be used for one-off CPU-bound activities, but its maximum size is so high that it doesn't really work well to do a
8181
* 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.
82+
* context-switching in order to try and make fair progress on all the threads at once. Better to submit fewer tasks and wait for
83+
* them to complete before submitting more, for instance using {@link ThrottledTaskRunner} and friends.
8484
* <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).
85+
* Likewise you can do IO on this pool, but using it for lots of concurrent IO is likely harmful in clusters with poor concurrent IO
86+
* performance (especially if using spinning disks).
8787
* <p>
88-
* Blocking on a future on this pool
89-
* risks deadlock if there's a chance that the completion of the future depends on work being done on this pool. Unfortunately
90-
* 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
91-
* size, but when it happens it is extremely harmful to the node.
88+
* Blocking on a future on this pool risks deadlock if there's a chance that the completion of the future depends on work being done
89+
* on this pool. Unfortunately that's pretty likely in most cases because of how often this pool is used; it's really rare because
90+
* of the high limit on the pool size, but when it happens it is extremely harmful to the node.
9291
* <p>
93-
* This pool is also used for recovery-related work. The recovery subsystem bounds its own concurrency, and therefore the amount of
94-
* recovery work done on the {@code #GENERIC} pool, via {@code cluster.routing.allocation.node_concurrent_recoveries} and related
95-
* settings.
96-
* <p>
97-
* Other subsystems
92+
* This pool is for instance used for recovery-related work, which is a mix of CPU-bound and IO-bound work. The recovery subsystem
93+
* bounds its own concurrency, and therefore the amount of recovery work done on the {@code #GENERIC} pool, via {@code
94+
* cluster.routing.allocation.node_concurrent_recoveries} and related settings. This pool is a good choice for recovery work because
95+
* the threads used by recovery will be used by other {@code #GENERIC} work too rather than mostly sitting idle until cleaned up.
96+
* Idle threads are surprisingly costly sometimes.
9897
* <p>
9998
* This pool does not reject any task. Tasks you submit to this executor after the pool starts to shut down may simply never run.
10099
*/

0 commit comments

Comments
 (0)