背景:采用mina和外部进行通信,在发送数据的方法上出现。
tracestack:
"" prio=10 tid=0x00007f1c7c1e0000 nid=0x3e31 in Object.wait() [0x00007f1cb48bf000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
at org.apache.mina.core.future.DefaultIoFuture.await0(DefaultIoFuture.java:189)
- locked <0x0000000708f1c838> (a org.apache.mina.core.future.DefaultWriteFuture)
at org.apache.mina.core.future.DefaultIoFuture.awaitUninterruptibly(DefaultIoFuture.java:130)
at org.apache.mina.core.future.DefaultWriteFuture.awaitUninterruptibly(DefaultWriteFuture.java:113)
定位:mina中发送数据采用的了awaitUninterruptibly(),造成了无限等待,线程一直挂起
解决:采用await(200)类似的办法,若为关键业务另外增加重试机制即可