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

Keith Wall updated QPID-6300:
-----------------------------
    Fix Version/s: qpid-java-6.0.3

> 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.24, 0.30
>         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
>             Fix For: qpid-java-6.0.3
>
>         Attachments: qpid-client-0.24.20150107.zip, qpid-client-6300.zip, 
> qpid-server-6300.png
>
>
> An auto delete queue is not recreated after a qpid shutdown and restart.
> Tests are done on the 0.24 version of the qpid-client library. The error is 
> still here on the 0.30 version.
> Here is the initial situation:
> - Multiple queues created, one in autodelete mode.
> - Server is up and running, client reading successfully incoming messages.
> Now, shut down the qpid server and restart it a few seconds later.
> The 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:
> {quote}
> 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
> {quote}
> The problem is due to the following code 
> (*org.apache.qpid.client.AMQSession_0_10.java*):
> {code:title=org.apache.qpid.client.AMQSession_0_10.java.java|borderStyle=solid}
>  public void resolveAddress(AMQDestination dest,
>                                               boolean isConsumer,
>                                               boolean noLocal) throws 
> AMQException {
> if (dest.isAddressResolved() && 
> dest.isResolvedAfter(getAMQConnection().getLastFailoverTime())) {
>             return;
>         }
>         else { ... }
> {code}
> As a matter of fact, dest.isAddressResolved() will be *true* and then nothing 
> will be recreated (*handleQueueNodeCreation()* will not be called in the else 
> part).
> The attachment *qpid-client-6300.zip* is a maven project (client side) to 
> reproduce the issue. The server side is defined in the attachment 
> *qpid-server-6300.png*.
> Therefore, here is a patch that solves the issue:
> {code:title=org.apache.qpid.client.AMQSession_0_10.java 
> patched|borderStyle=solid}
>    if (dest.isAddressResolved() && 
> dest.isResolvedAfter(getAMQConnection().getLastFailoverTime())) {
>               _logger.info("Destination {} already resolved", dest);
>    }
>    // Remove the else statement but keep code inside it
>         boolean assertNode = (dest.getAssert() == AddressOption.ALWAYS) ||
>                 (isConsumer && dest.getAssert() == AddressOption.RECEIVER) ||
> {code}
> The attachment *qpid-client-0.24.20150107.zip* is the patched version of the 
> qpid-client-0.24. You can edit the pom.xml of the client project 
> (qpid-client-6300.zip) to use it.



--
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