[ 
https://issues.apache.org/jira/browse/QPID-5439?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ulrich Romahn updated QPID-5439:
--------------------------------

    Attachment: threaddump-1388121261214.tdump

Attached threaddump during the hung application at connection.close().

It is clearly visible that this is causing a deadlock between thread 3 and 
thread 1 because they are waiting for the same lock on a java.lang.Object.

Thread-1:
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x00000000e11f0740> (a 
org.apache.qpid.amqp_1_0.transport.ConnectionEndpoint)
        at 
org.apache.qpid.amqp_1_0.framing.ConnectionHandler$FrameOutput.getNextFrame(ConnectionHandler.java:175)
        - locked <0x00000000e11f0740> (a 
org.apache.qpid.amqp_1_0.transport.ConnectionEndpoint)

Thread-3:
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x00000000e11f0740> (a 
org.apache.qpid.amqp_1_0.transport.ConnectionEndpoint)
        at java.lang.Object.wait(Object.java:503)
        at 
org.apache.qpid.amqp_1_0.jms.impl.SessionImpl$Dispatcher.run(SessionImpl.java:869)
        - locked <0x00000000e11f0740> (a 
org.apache.qpid.amqp_1_0.transport.ConnectionEndpoint)
        at java.lang.Thread.run(Thread.java:744)

I haven't figured out what exactly is causing this but as an "ugly" temporary 
workaround, I am trying to set a timeout on one wait() to break the deadlock.

> [AMQP 1.0 JMS client] Client hangs during connection.close()
> ------------------------------------------------------------
>
>                 Key: QPID-5439
>                 URL: https://issues.apache.org/jira/browse/QPID-5439
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client
>    Affects Versions: 0.27
>         Environment: qpid-cpp 0.27 (latest trunk), amqp-1-0-client-jms 
> 0.28-SNAPSHOT (latest trunk).
>            Reporter: Ulrich Romahn
>            Priority: Blocker
>         Attachments: threaddump-1388121261214.tdump
>
>
> I am connecting to a cpp broker via the amqp-1-0-client-jms client and send 
> 1000 simple text messages to a queue on the broker. After that, I am opening 
> a second session to receive those 1000 messages.
> When trying to close the connection (calling connection.close()), the client 
> "hangs". When I look at the broker (qpid-tool, list connection) I am still 
> seeing this connection open.
> Debugging through the code, shows that there is a lock in the class 
> org.apache.qpid.amqp_1_0.client.Sender at the following code in method 
> close():
> ...
>         _session.removeSender(this);
>         _endpoint.setSource(null);
>         _endpoint.detach();
>         _closed = true;
>         synchronized(_endpoint.getLock())
>         {
>             while(!_endpoint.isDetached())
>             {
>                 try
>                 {
>                     _endpoint.getLock().wait();
>                 }
>                 catch (InterruptedException e)
>                 {
>                     throw new SenderClosingException(e);
>                 }
>             }
>         }
> It actually seems to hang at the line " _endpoint.getLock().wait(); "
> NOTE: the exact same code works when running against a Java broker 0.24.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to