I'm using jetty-9 embedded for a proxy application (hosting netflix zuul). Unfortunately, some of the services behind the proxy have very long (as in one-hour long) timeouts. Most clients don't wait around for an hour. However, since the jetty server thread is blocked waiting for input from the remote server (the server that we are proxying), the thread doesn't have any way to act on this information.
Is there a way to interrupt or kill the jetty server thread when the client that called it closes its connection. Basically if the socket from the client is closed I want to interrupt that thread. Alternatively, if I knew the thread, I could map that to the outbound socket and close that instead, thereby waking up the thread.
I thought if I could get a list of sockets I could query them (?) to see if they are still alive? But how to drill down into the guts of the jetty engine to get a list of sockets, let alone a mapping of socket to jetty thread?