Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 7.0.0.pre5, 6.1.12
-
Fix Version/s: 7.0.0.pre5, 6.1.12
-
Component/s: None
-
Labels:None
-
Environment:C:\>java -version
java version "1.6.0_10-rc"
Java(TM) SE Runtime Environment (build 1.6.0_10-rc-b28)
Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)
-
Number of attachments :
Description
The following code:
AbstractConnector connector = new SelectChannelConnector();
connector.setAcceptors(30);
server.addConnector(connector);
worked with Jetty 6.1.6, but won't work with recent versions of Jetty (long pause followed by an empty page instead of a correctly served page).
Switching to SocketConnector wouldn't help.
What helps, though, is decreasing the number of acceptors to 20 or doing
server.setThreadPool(new QueuedThreadPool(40));
It seems that in the newer version of Jetty the pool is shared, but the connector starts all the threads beforehand and so the pool is depleted.
1. It is regression - old code which worked okey now doesn't works.
2. There is no diagnostics: no log messages or anything, the problem is hard to find.
BTW, a question: is it really necessary to start all the threads beforehand?
I now have a server where I have to set the number of threads to 90, just to be safe, but the real amount used might be less than 10.
If it is possible not to prestart all the threads, then how can it be achieved?
Thanks.