reactor线程阻塞引起故障

时间:2022-09-09 11:03:32
  • 大致线程模型:

reactor线程阻塞引起故障


  • jstack打印JVM堆栈,可以看到reactor线程阻塞了,导致它对应的前端连接无法使用。阻塞在了oracle驱动rollback动作,这里其实是因为oracle驱动为了保证串行请求响应而在底层加了锁,而这个通道被慢语句塞住了,所以reactor线程都塞了。
"$_NIOREACTOR-7-RW" prio=10 tid=0x00007f069856f000 nid=0xde1 waiting for monitor entry [0x00007f0677011000]
java.lang.Thread.State: BLOCKED (on object monitor)
at oracle.jdbc.driver.PhysicalConnection.rollback(PhysicalConnection.java:1167)
- waiting to lock <0x000000068086fbc0> (a oracle.jdbc.driver.T4CConnection)


"$_NIOREACTOR-4-RW" prio=10 tid=0x00007f069851e000 nid=0xddd waiting for monitor entry [0x00007f0677415000]
java.lang.Thread.State: BLOCKED (on object monitor)
at oracle.jdbc.driver.PhysicalConnection.rollback(PhysicalConnection.java:1167)
- waiting to lock <0x000000068083cf80> (a oracle.jdbc.driver.T4CConnection)


"$_NIOREACTOR-0-RW" prio=10 tid=0x00007f06984b2000 nid=0xdd9 waiting for monitor entry [0x00007f0677819000]
java.lang.Thread.State: BLOCKED (on object monitor)
at oracle.jdbc.driver.PhysicalConnection.rollback(PhysicalConnection.java:1167)
- waiting to lock <0x000000068081c5f0> (a oracle.jdbc.driver.T4CConnection)

reactor线程阻塞引起故障


  • 解决方案,异步化
    reactor线程阻塞引起故障