Skip to content

Conversation

@arsenalzp
Copy link
Contributor

This PR closes issue #13707

Signed-off-by: Oleksandr Krutko <[email protected]>
@joakime joakime requested a review from gregw October 22, 2025 20:35
@joakime joakime moved this to 👀 In review in Jetty 12.1.4 Oct 22, 2025
}
else if (maxPending == 0)
{
_maxPending = reservedThreads(executor, capacity);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_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.
Copy link
Contributor

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)
{
Copy link
Contributor

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.

@sbordet
Copy link
Contributor

sbordet commented Oct 23, 2025

@arsenalzp also please change the 3-parameters constructor to pass 0 as default value, not -1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

2 participants