On 2/20/2022 10:54 PM, Damien Urruty wrote:
Hello HttpClient developers, A user of our application SonarLint recently reported an issue (see thread <https://community.sonarsource.com/t/cpu-reaches-too-100-on-intellij-randomly/57710>). After some hours of use or after waking up the PC, the OP can barely use it since all CPUs are busy. It is the first time we receive such a report. As mentioned in the thread I found similar bug reports in different tools or in the JDK itself, but nothing was fixed. After investigation it appears that all httpclient-dispatch-* threads occupy 100% of the CPU. As we use the default configuration there are 24 JVM threads on this user's box (one per CPU thread). From the snapshot sent by the OP it seems that the time is spent in sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(long, int, int[], int[], int[], long, long), which is a native method. Maybe the Selector.select() always returns immediately ? Our application uses HttpClient 5.1.2. The config of the client can be found here <https://github.com/SonarSource/sonarlint-intellij/blob/master/src/main/java/org/sonarlint/intellij/http/ApacheHttpClient.kt#L114>. I don't have a reproducer but everything we do with HC is in this file. My guess is that it's not a bug with HttpClient itself, but rather in lower levels, maybe JDK, OS or network drivers. I'm asking for some help here: * I don't know if my reasoning is correct or not
Sounds plausible.
* I don't know how to find the root cause
I am afraid neither does anyone of us.
* If it's indeed a bug in a lower-level piece of code (e.g. JDK) I don't know how to escalate.
There is an Open JDK issue tracker / support mailing list
* also if it's the case maybe some workaround could be put in place in HttpClient.
That very much depends on the nature of the workaround you would like to propose.
In any case there is little we can do without a reliable reproducer. If there is a way to reproduce the issue outside of your specific environment there will be a way to resolve the problem or work it around.
Oleg
Happy to help debug this problem, and thank you for developing this lib! Damien Urruty | SonarSource Developer https://sonarsource.com <http://sonarsource.com/> Are you using SonarLint <http://www.sonarlint.org> in your IDE?
--------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org