我面临标准 java http 客户端的问题。由于某种原因,我还不知道它会进入无限循环并利用我拥有的所有CPU。下面是示例堆栈跟踪和无限循环运行的方法。
"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([email protected] /cdn-cgi/l/email-protection/SSLFlowDelegate.java:758)
at jdk.internal.net.http.common.SSLFlowDelegate$Writer$WriterDownstreamPusher.run([email protected] /cdn-cgi/l/email-protection/SSLFlowDelegate.java:645)
at jdk.internal.net.http.common.SequentialScheduler$CompleteRestartableTask.run([email protected] /cdn-cgi/l/email-protection/SequentialScheduler.java:147)
at jdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run([email protected] /cdn-cgi/l/email-protection/SequentialScheduler.java:198)
at jdk.internal.net.http.common.SequentialScheduler.runOrSchedule([email protected] /cdn-cgi/l/email-protection/SequentialScheduler.java:271)
at jdk.internal.net.http.common.SequentialScheduler.runOrSchedule([email protected] /cdn-cgi/l/email-protection/SequentialScheduler.java:224)
at jdk.internal.net.http.common.SSLFlowDelegate$Writer.triggerWrite([email protected] /cdn-cgi/l/email-protection/SSLFlowDelegate.java:722)
at jdk.internal.net.http.common.SSLFlowDelegate.doHandshake([email protected] /cdn-cgi/l/email-protection/SSLFlowDelegate.java:1024)
at jdk.internal.net.http.common.SSLFlowDelegate.doClosure([email protected] /cdn-cgi/l/email-protection/SSLFlowDelegate.java:1094)
at jdk.internal.net.http.common.SSLFlowDelegate$Reader.unwrapBuffer([email protected] /cdn-cgi/l/email-protection/SSLFlowDelegate.java:500)
at jdk.internal.net.http.common.SSLFlowDelegate$Reader.processData([email protected] /cdn-cgi/l/email-protection/SSLFlowDelegate.java:389)
- locked <0x0000000613d63450> (a java.lang.Object)
at jdk.internal.net.http.common.SSLFlowDelegate$Reader$ReaderDownstreamPusher.run([email protected] /cdn-cgi/l/email-protection/SSLFlowDelegate.java:263)
at jdk.internal.net.http.common.SequentialScheduler$SynchronizedRestartableTask.run([email protected] /cdn-cgi/l/email-protection/SequentialScheduler.java:175)
- locked <0x0000000613d63488> (a java.lang.Object)
at jdk.internal.net.http.common.SequentialScheduler$CompleteRestartableTask.run([email protected] /cdn-cgi/l/email-protection/SequentialScheduler.java:147)
at jdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run([email protected] /cdn-cgi/l/email-protection/SequentialScheduler.java:198)
at java.util.concurrent.ThreadPoolExecutor.runWorker([email protected] /cdn-cgi/l/email-protection/ThreadPoolExecutor.java:1128)
at java.util.concurrent.ThreadPoolExecutor$Worker.run([email protected] /cdn-cgi/l/email-protection/ThreadPoolExecutor.java:628)
at java.lang.Thread.run([email protected] /cdn-cgi/l/email-protection/Thread.java:834)
我认为问题的根本原因是this https://stackoverflow.com/questions/54485755/java-11-httpclient-leads-to-endless-ssl-loop一。但禁用 TLSv1.3 后问题并没有消失。
我在应用程序启动时使用调试检查了 TLSv1.3 是否以以下方式禁用:
这是我传入的 JVM 参数:
-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"
确保 TLSv1.3 已禁用。
请问,您知道问题的原因是什么吗?
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)