Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
1.0.10
-
None
-
None
-
Centos 5.3, JDK 1.6.0u11
Description
If a SocketAcceptor
- has multiple service addresses bound and
- you unbind one of them and
- disconnectOnUnbind is true and
- the one being unbound has at least one session connected and
- some other session on the acceptor also has at least one session connected
the unbind call can hang. Excerpt from stack trace below.
I suspect the hang is coming from IoServiceListenerSupport.disconnectSessions. The sessions to be closed are in the sessions variable, which is a subset of managedSessions (line 280). However, at lines 306-309, it is waiting (forever) for managedSessions to be empty. This will never happen.
This is 1..0.10. The 1.1.7 code is different (it uses a countdown latch), and looks OK.
"JBoss Shutdown Hook" daemon prio=10 tid=0x00002aab00d5b800 nid=0x114a in Object.wait() [0x00002aab23215000..0x00002aab23217c10]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:485)
at org.apache.mina.transport.socket.nio.SocketAcceptor.unbind(SocketAcceptor.java:213)
- locked <0x00002aaab0370000> (a org.apache.mina.transport.socket.nio.SocketAcceptor$CancellationRequest)
...
"SocketAcceptor-0" daemon prio=10 tid=0x00002aaafcd93000 nid=0x2ca in Object.wait() [0x000000004cbc8000..0x000000004cbc8a10]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
at org.apache.mina.common.support.IoServiceListenerSupport.disconnectSessions(IoServiceListenerSupport.java:308) - locked <0x00002aaab0376670> (a java.lang.Object)
at org.apache.mina.common.support.IoServiceListenerSupport.fireServiceDeactivated(IoServiceListenerSupport.java:165) - locked <0x00002aaab5e783c8> (a org.apache.mina.common.support.IoServiceListenerSupport)
at org.apache.mina.transport.socket.nio.SocketAcceptor.cancelKeys(SocketAcceptor.java:470)
at org.apache.mina.transport.socket.nio.SocketAcceptor.access$900(SocketAcceptor.java:53)
at org.apache.mina.transport.socket.nio.SocketAcceptor$Worker.run(SocketAcceptor.java:251)
at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
at java.lang.Thread.run(Thread.java:619)