Skip to content

Missing hook or statistic for QoSHandler rejections by exceeding setMaxSuspendedRequestCount #13246

@scscgit

Description

@scscgit

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 setMaxSuspend duration, we can override the protected method failSuspended and 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 triggered in case of failure when trying to handle a resumed request, but I believe that's pretty unlikely.
  • However, a similar option to measure the number of requests that have been instantly rejected due to exceeding the setMaxSuspendedRequestCount queue 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!

Metadata

Metadata

Assignees

Type

No type

Projects

Status

🏗 In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions