3

I facing a problem with standard java http client. By some reason that I don't know yet it go into infinite loop and utilize all cpus I have. Below is an example stack trace and a method where the infinity loop is running.

"HttpClient-1-Worker-34" #232 daemon prio=5 os_prio=0 cpu=37704.71ms elapsed=231.22s tid=0x00007f1580279000 nid=0x31fc runnable  [0x00007f1575059000]
   java.lang.Thread.State: RUNNABLE
    at jdk.internal.net.http.common.SSLFlowDelegate$Writer.processData(java.net.http@11.0.1/SSLFlowDelegate.java:758)
    at jdk.internal.net.http.common.SSLFlowDelegate$Writer$WriterDownstreamPusher.run(java.net.http@11.0.1/SSLFlowDelegate.java:645)
    at jdk.internal.net.http.common.SequentialScheduler$CompleteRestartableTask.run(java.net.http@11.0.1/SequentialScheduler.java:147)
    at jdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run(java.net.http@11.0.1/SequentialScheduler.java:198)
    at jdk.internal.net.http.common.SequentialScheduler.runOrSchedule(java.net.http@11.0.1/SequentialScheduler.java:271)
    at jdk.internal.net.http.common.SequentialScheduler.runOrSchedule(java.net.http@11.0.1/SequentialScheduler.java:224)
    at jdk.internal.net.http.common.SSLFlowDelegate$Writer.triggerWrite(java.net.http@11.0.1/SSLFlowDelegate.java:722)
    at jdk.internal.net.http.common.SSLFlowDelegate.doHandshake(java.net.http@11.0.1/SSLFlowDelegate.java:1024)
    at jdk.internal.net.http.common.SSLFlowDelegate.doClosure(java.net.http@11.0.1/SSLFlowDelegate.java:1094)
    at jdk.internal.net.http.common.SSLFlowDelegate$Reader.unwrapBuffer(java.net.http@11.0.1/SSLFlowDelegate.java:500)
    at jdk.internal.net.http.common.SSLFlowDelegate$Reader.processData(java.net.http@11.0.1/SSLFlowDelegate.java:389)
    - locked <0x0000000613d63450> (a java.lang.Object)
    at jdk.internal.net.http.common.SSLFlowDelegate$Reader$ReaderDownstreamPusher.run(java.net.http@11.0.1/SSLFlowDelegate.java:263)
    at jdk.internal.net.http.common.SequentialScheduler$SynchronizedRestartableTask.run(java.net.http@11.0.1/SequentialScheduler.java:175)
    - locked <0x0000000613d63488> (a java.lang.Object)
    at jdk.internal.net.http.common.SequentialScheduler$CompleteRestartableTask.run(java.net.http@11.0.1/SequentialScheduler.java:147)
    at jdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run(java.net.http@11.0.1/SequentialScheduler.java:198)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base@11.0.1/ThreadPoolExecutor.java:1128)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base@11.0.1/ThreadPoolExecutor.java:628)
    at java.lang.Thread.run(java.base@11.0.1/Thread.java:834)

I thought that root cause of the problem is this one. But after disabling TLSv1.3 the issue is not go away.

I checked if TLSv1.3 is disable in the following way using debug at start up of application:

TLSv.1.3 disabled

Here is JVM parameters I pass in:

-Djdk.tls.disabledAlgorithms="TLSv1.3"
-Dhttps.protocols="TLSv1,TLSv1.1,TLSv1.2"
-Djdk.tls.client.protocols="TLSv1,TLSv1.1,TLSv1.2"
-Djdk.tls.server.protocols="TLSv1,TLSv1.1,TLSv1.2"

to be sure that TLSv1.3 is disabled.

Please, any ideas what can be a reason of the issue?

slesh
  • 1,902
  • 1
  • 18
  • 29
  • Is it host specific or does it occur on various hosts? – Robert Mar 24 '19 at 16:29
  • It occurs at least on both localhost and stg hosts – slesh Mar 25 '19 at 06:08
  • @slesh did you resolved it? – Vitek Jun 23 '19 at 16:57
  • Sorry for been so late. Yeah, I spend a lot of time trying to solve the issue but unfortunately the only solution that worked for me was migration to JDK12. Hope I helped you. – slesh Jul 01 '19 at 19:39
  • I believe I ran into the same issue with jdk 11.0.2. I tried to upgrade to 11.0.6 but it still happened. Upgrading to 13.0.2 seems to solve the issue though. Upgrading to solve such a problems isn't necessarily weird, but I would have guessed, that such a big problem will be backported. So maybe I did something wrong. Anyway 13 seems to work – Simon Lenz Feb 10 '20 at 21:23
  • 1
    @SimonLenz the fix was backported to 11.0.8 https://bugs.openjdk.java.net/browse/JDK-8241054https://bugs.openjdk.java.net/browse/JDK-8241054 – Hamdi Sep 04 '20 at 16:18

0 Answers0