Running with Jetty 9.1, it seems that flush()ing the response hangs and blocks the thread when the request was from an in-browser ajax call, so I commented out the flush() before close().