Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thread starvation when downloading keys over HTTP #846

Open
zilinjak opened this issue Jan 9, 2025 · 0 comments
Open

Thread starvation when downloading keys over HTTP #846

zilinjak opened this issue Jan 9, 2025 · 0 comments

Comments

@zilinjak
Copy link

zilinjak commented Jan 9, 2025

I have this configuration:

mp.jwt.verify.publickey.location=${quarkus.mockserver.endpoint}/pub-keys
smallrye.jwt.jwks.refresh-interval=60
smallrye.jwt.jwks.forced-refresh-interval=1
smallrye.jwt.jwks.retain-cache-on-error-duration=1

Which should refresh keys every 60 minutes, if it fails to fetch them it should retry every 1 minute (not on every request). But Im getting into problems when we are testing that the /pub-keys takes longer to respond, this leads to thread blocking and later it can cause most likely thread starvation - we have encountered problem when the service was not able to receive more requests and the log was filled with vertx thread blocking errors.

Possible improvements

run the HTTP request on the IO thread pool - current implementation uses

simpleHttpGet.get(location);

which is not ideal and runs on vertx event loop and is blocking.

able to set timeout for the request to wait and if fails use the old cache when present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant