jetty.project
jetty.project copied to clipboard
Strengthen the Request.addFailureListener() contract
trafficstars
Jetty version(s) 12.0.x
Description
The current javadoc of Request.addFailureListener() is under-specified and not particularly clear.
Furthermore, there is a chance that a failure happens when the demand callback is just about to be run. In this case, the demand callback will read a failure, and the failure listener will be invoked. We can easily cover for this case, since we control all threads.
In the case of threads spawned by the application, the failure can be notified both via a read and via the failure listener, since we have no control over the threads.