[jboss-jira] [JBoss JIRA] Updated: (JBREM-845) Infinite loop in BisocketClientInvoker.createSocket
Ron Sigal (JIRA)
jira-events at lists.jboss.org
Tue Nov 13 19:16:18 EST 2007
[ http://jira.jboss.com/jira/browse/JBREM-845?page=all ]
Ron Sigal updated JBREM-845:
----------------------------
Attachment: jboss-remoting.jar
Looking at the attached thread dump, it seems that the problem described in this issue is the same as that described in JBREM-822 "Avoid deadlock when Connector shuts down while callback client invoker is in handleConnect()". One difference is that the event described in JBREM-822 occurred as the Application Server was shutting down, and the event described here occurred when a JBossMessaging connection was shutting down. In both cases, though, it seems that a JBossMessaging connection is shutting down before it is fully created. As a result, the callback BisocketClientInvoker is waiting in createdSocket() for a socket that never arrives, and since JBossMessaging uses a timeout value of zero, BisocketClientInvoker waits forever.
I've changed the loop so that it wakes up every second and tests isConnected(), and if isConnected() is false, then createSocket() exits the loop:
while (timeout == 0 || timeRemaining > 0)
{
try
{
sockets.wait(1000);
if (!sockets.isEmpty() || !isConnected())
break;
}
catch (InterruptedException e)
{
log.debug("unexpected interrupt");
}
if (timeout > 0)
timeRemaining = timeout - (System.currentTimeMillis() - start);
}
}
> Infinite loop in BisocketClientInvoker.createSocket
> ---------------------------------------------------
>
> Key: JBREM-845
> URL: http://jira.jboss.com/jira/browse/JBREM-845
> Project: JBoss Remoting
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 2.2.2.GA_CP01, 2.2.2.SP2
> Reporter: Carlo de Wolf
> Priority: Blocker
> Attachments: jboss-remoting.jar, strictpool-shutdown-EAP-4.3.hang.txt
>
>
> The following piece of code constitutes an infinite loop when timeout = 0:
> while (timeout == 0 || wait > 0)
> {
> try
> {
> sockets.wait(wait);
> break;
> }
> catch (InterruptedException e)
> {
> log.debug("unexpected interrupt");
> if (timeout > 0)
> wait = timeout - (System.currentTimeMillis() - start);
> }
> }
> "Thread-41" prio=1 tid=0x00002aaaac3cd0b0 nid=0x2e87 in Object.wait() [0x0000000048fe3000..0x0000000048fe3d80]
> at java.lang.Object.wait(Native Method)
> - waiting on <0x00002b7156e2f410> (a java.util.HashSet)
> at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.createSocket(BisocketClientInvoker.java:458)
> - locked <0x00002b7156e2f410> (a java.util.HashSet)
> at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.getConnection(MicroSocketClientInvoker.java:815)
> at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:525)
> at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.transport(BisocketClientInvoker.java:413)
> at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
> at org.jboss.remoting.Client.invoke(Client.java:1634)
> at org.jboss.remoting.Client.invoke(Client.java:548)
> at org.jboss.remoting.Client.invokeOneway(Client.java:598)
> at org.jboss.remoting.callback.ServerInvokerCallbackHandler.handleCallback(ServerInvokerCallbackHandler.java:815)
> at org.jboss.remoting.callback.ServerInvokerCallbackHandler.handleCallbackOneway(ServerInvokerCallbackHandler.java:686)
> at org.jboss.jms.server.endpoint.ServerSessionEndpoint.performDelivery(ServerSessionEndpoint.java:1490)
> - locked <0x00002b71569e25e8> (a org.jboss.remoting.transport.bisocket.BisocketClientInvoker)
> at org.jboss.jms.server.endpoint.ServerSessionEndpoint.handleDelivery(ServerSessionEndpoint.java:1375)
> - locked <0x00002b71569dfd40> (a org.jboss.jms.server.endpoint.ServerSessionEndpoint)
> at org.jboss.jms.server.endpoint.ServerConsumerEndpoint.handle(ServerConsumerEndpoint.java:307)
> - locked <0x00002b71569ed6b0> (a java.lang.Object)
> at org.jboss.messaging.core.impl.RoundRobinDistributor.handle(RoundRobinDistributor.java:119)
> at org.jboss.messaging.core.impl.MessagingQueue$DistributorWrapper.handle(MessagingQueue.java:582)
> at org.jboss.messaging.core.impl.ClusterRoundRobinDistributor.handle(ClusterRoundRobinDistributor.java:79)
> at org.jboss.messaging.core.impl.ChannelSupport.deliverInternal(ChannelSupport.java:476)
> at org.jboss.messaging.core.impl.MessagingQueue.deliverInternal(MessagingQueue.java:505)
> at org.jboss.messaging.core.impl.ChannelSupport.deliver(ChannelSupport.java:226)
> - locked <0x00002b71565d3d50> (a java.lang.Object)
> at org.jboss.jms.server.endpoint.ServerSessionEndpoint$2.run(ServerSessionEndpoint.java:1598)
> at EDU.oswego.cs.dl.util.concurrent.QueuedExecutor$RunLoop.run(QueuedExecutor.java:89)
> at java.lang.Thread.run(Thread.java:595)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list