HttpClient thread stuck using 100% cpu on JDK17
Issue
-
The following sequence of events leaves the HttpClient thread stuck using 100% cpu:
-
After a successful HTTPS request, the connection in HttpClient pool remains open (keep-alive).
-
75 seconds later, the remote server initiates closing the connection.
-
The HttpClient worker thread with the stack trace below uses 100% CPU:
"HttpClient-1-Worker-2" #17 daemon prio=5 os_prio=0 cpu=27904.71ms elapsed=28.16s tid=0x00007fb10c00e860 nid=0x105e76 runnable [0x00007fb1959fd000] java.lang.Thread.State: RUNNABLE at sun.security.ssl.SSLEngineImpl.unwrap(java.base@17.0.17/SSLEngineImpl.java:506) at sun.security.ssl.SSLEngineImpl.unwrap(java.base@17.0.17/SSLEngineImpl.java:482) at javax.net.ssl.SSLEngine.unwrap(java.base@17.0.17/SSLEngine.java:679) at jdk.internal.net.http.common.SSLFlowDelegate$Reader.unwrapBuffer(java.net.http@17.0.17/SSLFlowDelegate.java:543) at jdk.internal.net.http.common.SSLFlowDelegate$Reader.processData(java.net.http@17.0.17/SSLFlowDelegate.java:447) locked <0x000000060f40c140> (a java.lang.Object) at jdk.internal.net.http.common.SSLFlowDelegate$Reader$ReaderDownstreamPusher.run(java.net.http@17.0.17/SSLFlowDelegate.java:282) at jdk.internal.net.http.common.SequentialScheduler$LockingRestartableTask.run(java.net.http@17.0.17/SequentialScheduler.java:205) at jdk.internal.net.http.common.SequentialScheduler$CompleteRestartableTask.run(java.net.http@17.0.17/SequentialScheduler.java:149) at jdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run(java.net.http@17.0.17/SequentialScheduler.java:230) at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base@17.0.17/ThreadPoolExecutor.java:1136) at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base@17.0.17/ThreadPoolExecutor.java:635) at java.lang.Thread.run(java.base@17.0.17/Thread.java:840) -
-
Only restarting resolves the issue.
Environment
- OpenJDK17
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.