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

Java 11 Http2Client thread leak. #1523

Closed
czubin opened this issue Oct 21, 2021 · 0 comments · Fixed by #1532
Closed

Java 11 Http2Client thread leak. #1523

czubin opened this issue Oct 21, 2021 · 0 comments · Fixed by #1532

Comments

@czubin
Copy link
Contributor

czubin commented Oct 21, 2021

We noticed that the feign.http2client.Http2Client during high load will generate a lot of inactive threadsL:

Namely during the execute part the client will call the getOrCreateClient() method.

If the Http2Client was created using the default constructor.
Then the getOrCreateClient() method will always create a new http client along with a new threadpool.

This is because the options supplied during the request do not match the options used during the initial creation.
I.e. the code
client.connectTimeout() .map(timeout -> timeout.toMillis() != options.connectTimeoutMillis()) .orElse(true); will always return true.

Hence during each request a new client is instantiated along with a new threadpool.
During high load this will cause the application to run out of memory.

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

Successfully merging a pull request may close this issue.

1 participant