记一次钉钉报警线上bug

2020-08-26  本文已影响0人  zh_harry

案发现场

https://oapi.dingtalk.com/robot/send?access_token=${token}
JDK 版本 1.8.0_20
钉钉java client

version=0.9.0-SNAPSHOT
groupId=com.dingtalk.chatbot
artifactId=dingtalk-chatbot-sdk

线上报警较多时导致线上延迟严重
jstack 日志如下

 java.lang.Thread.State: BLOCKED (on object monitor)
        at sun.security.ssl.CipherSuite$BulkCipher.clearAvailableCache(CipherSuite.java:537)
        - waiting to lock <0x0000000683405988> (a java.lang.Class for sun.security.ssl.CipherSuite$BulkCipher)
        at sun.security.ssl.SSLContextImpl.clearAvailableCache(SSLContextImpl.java:390)
        at sun.security.ssl.SSLContextImpl.getDefaultCipherSuiteList(SSLContextImpl.java:297)
        - locked <0x00000007b38e98b8> (a sun.security.ssl.SSLContextImpl$TLSContext)
        at sun.security.ssl.SSLSocketImpl.init(SSLSocketImpl.java:607)
        at sun.security.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:549)
        at sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:110)
        at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:393)
        at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:384)

发现锁共95个线程被block
locked <0x00000007b38e98b8>

$ less jstack.log |grep 0x0000000683405988|wc -l
95

线下压测重现 钉钉报警最大延迟可达8s左右。

原因

由于某业务延迟较高会触耗时钉钉报警,钉钉报警走https协议需要加密,触发JDK1.8 bug


(https://bugs.java.com/bugdatabase/view_bug.do?bug_id=jdk-8133070)

附bug地址
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=jdk-8133070

上一篇下一篇

猜你喜欢

热点阅读