-
Notifications
You must be signed in to change notification settings - Fork 2k
Limit ReservedThread creation #13837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: jetty-12.1.x
Are you sure you want to change the base?
Conversation
Signed-off-by: Oleksandr Krutko <alexander.krutko@gmail.com>
| } | ||
| else if (maxPending == 0) | ||
| { | ||
| _maxPending = reservedThreads(executor, capacity); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| _maxPending = reservedThreads(executor, capacity); | |
| _maxPending = _threads.capacity(); |
| * is calculated based on a heuristic from the number of available processors and | ||
| * thread pool type. | ||
| * @param minSize The minimum number of reserve Threads that the algorithm tries to maintain, or -1 for a heuristic value. | ||
| * @param maxPending The maximum number of reserved Threads to start, or -1 for no limit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the javadoc with the meaning of the value 0.
| throw new IllegalArgumentException("maxPending cannot be 0"); | ||
|
|
||
| if (maxPending < 0) | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the braces for these one-line if/else statements.
|
@arsenalzp also please change the 3-parameters constructor to pass 0 as default value, not -1. |
This PR closes issue #13707