- 
        Couldn't load subscription status. 
- Fork 2k
Closed
Labels
Description
Jetty version(s)
jetty-server-12.0.15
Enhancement Description
QoSHandler, which is recommended by the Thread Pool documentation (and addresses issues like #13004), can be configured using parameters like:
- setMaxRequestCount
- setMaxSuspend
- setMaxSuspendedRequestCount
To monitor the server state or measure statistics:
- As long as some requests are suspended, it's possible to retrieve their current count using getSuspendedRequestCount.
- To count the number of rejections due to exceeding the setMaxSuspendduration, we can override the protected methodfailSuspendedand use it as a hook.- Though, the we can't perfectly rely on it, because in addition to in case of timeout while suspended, it also documents that it's triggeredin case of failure when trying to handle a resumed request, but I believe that's pretty unlikely.
 
- Though, the we can't perfectly rely on it, because in addition to 
- However, a similar option to measure the number of requests that have been instantly rejected due to exceeding the setMaxSuspendedRequestCountqueue size is not available.
My suggestion is that you could extend the API to either:
- expose a hook method to handle the rejection due to a full queue, or
- measure the number of rejections directly.
There is actually a method in QoSHandler that already handles this, named notAvailable. However, it is a private method. Can you please consider changing it to a protected method? :)
- If we needed a workaround, due to the Java reflection limitations, we'd probably have to resort to AOP or a bytecode manipulation...
Thx!