I have a Jetty server handling long running HTTP requests- the responses are generated by an a different process X and end up in a collector hash which Jetty requests periodical
Using try catch block might help in this case.
try{ ctx.complete() } catch (IllegalStateException e){ //Handle it the way you prefer. }