Thread hung in org.jboss.remoting3.spi.AbstractHandleableCloseable.close in JBoss EAP 6
Environment
Red Hat JBoss Enterprise Application Platform (EAP) 6.4
Issue
- We are seeing a thread hung or stuck and never gets past
org.jboss.remoting3.spi.AbstractHandleableCloseable.close. We saw it during a stress test with cpu starvation under load. The thread stack is:
"Remoting "master:client-one:MANAGEMENT" task-3" prio=10 tid=0x00007f4a100fc800 nid=0x44b3 in Object.wait() [0x00007f4a68999000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000fe87aee0> (a java.lang.Object)
at java.lang.Object.wait(Object.java:485)
at org.jboss.remoting3.spi.AbstractHandleableCloseable.close(AbstractHandleableCloseable.java:190)
- locked <0x00000000fe87aee0> (a java.lang.Object)
at org.xnio.IoUtils.safeClose(IoUtils.java:137)
at org.jboss.remoting3.EndpointImpl$5.handleDone(EndpointImpl.java:317)
at org.jboss.remoting3.EndpointImpl$5.handleDone(EndpointImpl.java:293)
at org.xnio.IoFuture$HandlingNotifier.notify(IoFuture.java:212)
at org.xnio.AbstractIoFuture$NotifierRunnable.run(AbstractIoFuture.java:729)
at org.xnio.IoUtils$2.execute(IoUtils.java:72)
at org.xnio.AbstractIoFuture.runNotifier(AbstractIoFuture.java:702)
at org.xnio.AbstractIoFuture$NotifierState.doNotify(AbstractIoFuture.java:275)
at org.xnio.AbstractIoFuture$NotifierState.notifyDone(AbstractIoFuture.java:256)
at org.xnio.AbstractIoFuture.setResult(AbstractIoFuture.java:628)
at org.xnio.FutureResult.setResult(FutureResult.java:83)
at org.xnio.IoUtils$ResultNotifier.handleDone(IoUtils.java:684)
at org.xnio.IoUtils$ResultNotifier.handleDone(IoUtils.java:673)
at org.xnio.IoFuture$HandlingNotifier.notify(IoFuture.java:212)
at org.xnio.AbstractIoFuture$NotifierRunnable.run(AbstractIoFuture.java:729)
at org.xnio.IoUtils$2.execute(IoUtils.java:72)
at org.xnio.AbstractIoFuture.runNotifier(AbstractIoFuture.java:702)
at org.xnio.AbstractIoFuture$NotifierState.doNotify(AbstractIoFuture.java:275)
at org.xnio.AbstractIoFuture$NotifierState.notifyDone(AbstractIoFuture.java:256)
at org.xnio.AbstractIoFuture$NotifierState.notifyDone(AbstractIoFuture.java:257)
at org.xnio.AbstractIoFuture$CancellableState.notifyDone(AbstractIoFuture.java:334)
at org.xnio.AbstractIoFuture.setResult(AbstractIoFuture.java:628)
at org.xnio.FutureResult.setResult(FutureResult.java:83)
at org.jboss.remoting3.remote.ClientConnectionOpenListener$Authentication$2.run(ClientConnectionOpenListener.java:763)
at org.jboss.remoting3.EndpointImpl$TrackingExecutor$1.run(EndpointImpl.java:731)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
Resolution
Apply JBoss EAP 6.4 Cumulative Patch (CP) 7 or later
Root Cause
When the CPU is under load, the timing of the connection start up tasks can be delayed. so JBoss received a connection before the endpoint close, but the full connection start (handleDone) didn't occur until after the endpoint close was initiated. This gets us into a state where the connection is able to come in, endpoint closes, then the connection finishes adding itself to the closed endpoint's connections map and will never be closed.
Diagnostic Steps
Take a series of thread dumps and look for a thread that is not progressing beyond this line:
at org.jboss.remoting3.spi.AbstractHandleableCloseable.close(AbstractHandleableCloseable.java:190)
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.