Details
Description
Upgrading from 7.2 to 7.5/8.0 caused the following code to freeze/hang all requests to the created instance indefinitely.
Server server = new Server(); SelectChannelConnector connector = new SelectChannelConnector(); connector.setPort(9090); QueuedThreadPool threadPool = new QueuedThreadPool(); connector.setThreadPool(threadPool); server.addConnector(connector); // ... add a servlet handler server.start();
If you explicitly start the QueuedThreadPool instance before starting the server instance it will work. This seems very odd, since the thread pool is started in AbstractConnector.doStart().
Attached is a maven project with a test case that reproduces the problem.
JETTY-1428 seems to be the same issue, but it was dismissed because a custom built threadpool was used.
Fixed by ensuring the threadpool is started before starting the selector manager.