Antoine Carton created QPID-6300:
------------------------------------

             Summary: Fail to reconnect after qpid shutdown and restart, for an 
auto-delete queue
                 Key: QPID-6300
                 URL: https://issues.apache.org/jira/browse/QPID-6300
             Project: Qpid
          Issue Type: Bug
          Components: Java Client
    Affects Versions: 0.30, 0.24
         Environment: Qpid server running on CentOS release 6.5 (Final):
- OS : Linux version: 2.6.32-431.29.2.el6.x86_64 arch: amd64
- Platform : JVM : Oracle Corporation version: 
1.7.0_65-mockbuild_2014_07_16_06_06-b00 
- Java:
java version "1.7.0_65"
OpenJDK Runtime Environment (rhel-2.5.1.2.el6_5-x86_64 u65-b17)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)


Qpid java client running on Ubuntu 14.04 with:
- Java: 
java version "1.7.0_60"
Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)
            Reporter: Antoine Carton
            Priority: Blocker


An auto delete queue is not recreated after a qpid shutdown and restart.

Here is the initial situation:
- Multiple queues created, one in autodelete mode.
- Server is up and running, client reading successfully incoming messages.

Now, I shut down the qpid server and restart it a few seconds later.

My qpid client can not recover from that for the auto delete queue: it shuts 
down the sessions, the connection, try to reconnect and recreate sessions and 
consumer, but it never succeeds:

Here is a stacktrace:

Active session count: 2: org.apache.qpid.AMQException: timed out waiting for 
sync: complete = 0, point = 2 [error code 541: internal error]
        at 
org.apache.qpid.client.AMQConnection.exceptionReceived(AMQConnection.java:1269)
        at 
org.apache.qpid.client.AMQSession_0_10.setCurrentException(AMQSession_0_10.java:1101)
        at 
org.apache.qpid.client.AMQSession_0_10.sync(AMQSession_0_10.java:1065)
        at 
org.apache.qpid.client.AMQSession_0_10.sendSuspendChannel(AMQSession_0_10.java:844)
        at 
org.apache.qpid.client.AMQSession.suspendChannel(AMQSession.java:3028)
        at org.apache.qpid.client.AMQSession.stop(AMQSession.java:2378)
        at 
org.apache.qpid.client.AMQSession_0_10.stop(AMQSession_0_10.java:1421)
        at org.apache.qpid.client.AMQConnection.stop(AMQConnection.java:835)
        at 
org.springframework.jms.connection.SingleConnectionFactory.closeConnection(SingleConnectionFactory.java:422)
        at 
org.springframework.jms.connection.SingleConnectionFactory.resetConnection(SingleConnectionFactory.java:321)
        at 
org.springframework.jms.connection.CachingConnectionFactory.resetConnection(CachingConnectionFactory.java:199)
        at 
org.springframework.jms.connection.SingleConnectionFactory.onException(SingleConnectionFactory.java:302)
        at 
org.springframework.jms.connection.ChainedExceptionListener.onException(ChainedExceptionListener.java:57)
        at 
org.apache.qpid.client.AMQConnection.exceptionReceived(AMQConnection.java:1329)
        at 
org.apache.qpid.client.AMQSession_0_10.setCurrentException(AMQSession_0_10.java:1101)
        at 
org.apache.qpid.client.AMQSession_0_10.exception(AMQSession_0_10.java:939)
        at 
org.apache.qpid.transport.SessionDelegate.executionException(SessionDelegate.java:182)
        at 
org.apache.qpid.transport.SessionDelegate.executionException(SessionDelegate.java:32)
        at 
org.apache.qpid.transport.ExecutionException.dispatch(ExecutionException.java:103)
        at 
org.apache.qpid.transport.SessionDelegate.command(SessionDelegate.java:55)
        at 
org.apache.qpid.transport.SessionDelegate.command(SessionDelegate.java:50)
        at 
org.apache.qpid.transport.SessionDelegate.command(SessionDelegate.java:32)
        at org.apache.qpid.transport.Method.delegate(Method.java:159)
        at org.apache.qpid.transport.Session.received(Session.java:596)
        at org.apache.qpid.transport.Connection.dispatch(Connection.java:437)
        at 
org.apache.qpid.transport.ConnectionDelegate.handle(ConnectionDelegate.java:64)
        at 
org.apache.qpid.transport.ConnectionDelegate.handle(ConnectionDelegate.java:40)
        at 
org.apache.qpid.transport.MethodDelegate.executionException(MethodDelegate.java:110)
        at 
org.apache.qpid.transport.ExecutionException.dispatch(ExecutionException.java:103)
        at 
org.apache.qpid.transport.ConnectionDelegate.command(ConnectionDelegate.java:54)
        at 
org.apache.qpid.transport.ConnectionDelegate.command(ConnectionDelegate.java:40)
        at org.apache.qpid.transport.Method.delegate(Method.java:159)
        at org.apache.qpid.transport.Connection.received(Connection.java:390)
        at org.apache.qpid.transport.Connection.received(Connection.java:62)
        at org.apache.qpid.transport.network.Assembler.emit(Assembler.java:97)
        at 
org.apache.qpid.transport.network.Assembler.assemble(Assembler.java:198)
        at org.apache.qpid.transport.network.Assembler.frame(Assembler.java:131)
        at org.apache.qpid.transport.network.Frame.delegate(Frame.java:128)
        at 
org.apache.qpid.transport.network.Assembler.received(Assembler.java:102)
        at 
org.apache.qpid.transport.network.Assembler.received(Assembler.java:44)
        at 
org.apache.qpid.transport.network.InputHandler.next(InputHandler.java:189)
        at 
org.apache.qpid.transport.network.InputHandler.received(InputHandler.java:105)
        at 
org.apache.qpid.transport.network.InputHandler.received(InputHandler.java:44)
        at 
org.apache.qpid.transport.network.io.IoReceiver.run(IoReceiver.java:161)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.qpid.AMQException: timed out waiting for sync: complete = 
0, point = 2 [error code 541: internal error]
        at 
org.apache.qpid.client.AMQSession_0_10.setCurrentException(AMQSession_0_10.java:1085)
        ... 43 more


The problem is due to the following code 
(org.apache.qpid.client.AMQSession_0_10.java):

{quote}
 public void resolveAddress(AMQDestination dest,
                                              boolean isConsumer,
                                              boolean noLocal) throws 
AMQException {
if (dest.isAddressResolved() && 
dest.isResolvedAfter(getAMQConnection().getLastFailoverTime())) {
            return;
        }
        else { ... }
{quote}
As a matter of fact, dest.isAddressResolved() will be true and then nothing 
will be recreated (handleQueueNodeCreation in the else part).

The first attachment is a maven project (client side) to reproduce the issue. 
The server side is defined in the attachment 2.

Therefore, here is a patch that solves the issue:
{quote}
if (dest.isAddressResolved() && 
dest.isResolvedAfter(getAMQConnection().getLastFailoverTime())) {
            //return;
        //}
        //else { 
        ... 
       //}
{quote}

The qpid-client-0.24.20150107 (attachment 3) is the patched version of the 
qpid-client-0.24.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to