Details
-
Type:
Bug
-
Status: Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.18.2
-
Component/s: camel-jetty
-
Labels:None
-
Estimated Complexity: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