Hello,

When using multiple threads to send HttpRequests from a static final
HttpClient instance, I noticed that CPU use spikes after a minute or so.

I created a reproducible example that I've tested on Java 11.0.2 and
13-ea:  https://gist.github.com/AugustNagro/fec5f7895bd8bb5db66f2ed9cfafc35c

This bug never occurs when using a single thread. Also, switching TLS to
1.2 or 1.1 does not fix the issue. Looking at VisualVM it seems that
SSLFlowDelegate is entering some sort of race condition.

Is this a bug in java.net.HttpClient, or should I not be accessing the
HttpClient from multiple threads?

Regards,

August Nagro

PS: Could this be related to (fixed)
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8217094?

Reply via email to