Community
Participate
Working Groups
Build Identifier: 7.2.0.v20101020, trunk I hit this problem with Apache Geronimo after they upgraded to Jetty 7.2.0.v20101020. The very slow shutdown of Geronimo was caused by it using too many threads, see GERONIMO-5668, but as Shawn Jiang from Geronimo has pointed out, Jetty will always use 1 second per acceptor thread to stop. I have debugged this and found that the Closer used by the SelectSet in SelectorManager will never run. I don't know why, but at during shutdowns the doSelect() method of SelectSet is never called. Calling this method after adding the Closer to the list of changes results in the Closer actually being processed. I will attach a patch for this, though it might be better to solve the underlaying problem that prevents changes from being processed in the first place. Reproducible: Always Steps to Reproduce: 1. Start the server 2. Stop the server
Created attachment 182134 [details] Shutdown patch for SelectorManager Patch created against Jetty trunk revision 2459. I grant you this under that Apache License version 2.0.
That code was changed to avoid a rare race condition of closing while the selection was in process. It obviously has harmed the normal shutdown. It's now been replaced by a simple spin check that waits for the the selector to exit before closing endpoints and the connector. r2460
Many thanks, this makes the shutdown very fast.