Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.18.2
-
None
-
Novice
Description
In JettyHttpComponent, "createHttpClientTransport" method the number of selectors is derived by:
int selectors = Runtime.getRuntime().availableProcessors() / 2;
If the number of available processors is 1, divided by 2, cast to int is 0 which causes an IllegalArgumentException.
The safe way to do this is via Math.max, like the Jetty code does:
int selector = Math.max(1, Runtime.getRuntime().availableProcessors() / 2);
As per the code this is only exercised when maxThreads is not null, otherwise the default constructor is called and selectors are created properly.
Attachments
Issue Links
- links to