Repository navigation
Provide an HTTP 503 response when the thread pool rejected the request - #21963
Conversation
There was a problem hiding this comment.
Unreported flaky test detected, please review
Unreported flaky test detectedIf the below flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.forms.LoginTest#loginDifferentUserAfterDisabledUserThrownOutKeycloak CI - Forms IT (firefox) |
There was a problem hiding this comment.
Thanks for the PR @ahus1. This change makes sense to me, although I still think it'd make sense to have this logged (perhaps as a warning?) on top of the HTTP 503 response. That'd help to make it clear what's happening to a user who's not very familiar with the internals.
091e0f5 to
a170899
Compare
This allows for limiting the queue of the thread pool to avoid overloading Keycloak. Closes keycloak#21962
a170899 to
5278d99
Compare
|
@vmuzikar - logging a warning for each dropped request would be an anti-pattern as it would amplify the load on the logging system. In our load tests I expect this to drop thousands of messages in an overloaded situation. I've updated this PR to log a warning when Keycloak starts dropping requests and then another warning once it continues processing with an approximation of the dropped requests. The output is as follows:
We can tune this more once we see it is useful in our tests. |
|
@ahus1 Would it be possible to expose the number of rejected requests and also the waiting queue length as metric? |
|
@sschu - I've raised an issue here: quarkusio/quarkus#34998 I still need to reply there, as I think Vert.x is not exposing of all the metrics we would want to see. When running with the OTEL agent, I saw the 503 in the responses as a counter, which was working for me. The current queue length would be nice indeed. Maybe even nicer: A histogram of the queue length capturing the length of the queue when something was added, so we wouldn't be limited to the value which is polled every some seconds? But I think the chances to get that would be nearly zero. |
This allows for limiting the queue of the thread pool to avoid overloading Keycloak.
Closes #21962