Hello, Just want to add that selector problems have not been seldom in the past, and that there is also currently a project to replace the selector socket mechanism on Windows. ( https://mail.openjdk.java.net/pipermail/nio-dev/2021-May/008988.html )
And there have been some problems with timers after wakeup in the past. But I don’t think those problems should persist in recent java versions (moved to the monotonic nanoTime). I would discuss this on the OpenJDK nio-dev list, but as Oleg wrote, it might be hard to proceed without an easy reproducer. Gruss Bernd -- http://bernd.eckenfels.net ________________________________ Von: Oleg Kalnichevski <ol...@apache.org> Gesendet: Montag, Februar 21, 2022 12:26 PM An: HttpClient User Discussion; Damien Urruty Betreff: Re: CPU usage at 100% after a while 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