Possible concurrency bug in Java client AMQPConnection.MainLoop()

148 views
Skip to first unread message

Rac Lst

unread,
Aug 1, 2014, 7:02:18 PM8/1/14
to rabbitm...@googlegroups.com
Hello,

In the 3.2.4 version of this client, there appears to be a concurrent bug on line 543 regarding the call to isOpen(). A return status of "true" does not appear to guarantee that the channel is really open which would result in the following exception being thrown:

com.rabbitmq.client.ShutdownSignalException: connection error; reason: com.rabbitmq.client.impl.UnknownChannelException: Unknown channel number 16
 at com.rabbitmq.client.impl.AMQConnection.startShutdown(AMQConnection.java:715)
 at com.rabbitmq.client.impl.AMQConnection.shutdown(AMQConnection.java:705)
 at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:568)
Caused by: com.rabbitmq.client.impl.UnknownChannelException: Unknown channel number 16
 at com.rabbitmq.client.impl.ChannelManager.getChannel(ChannelManager.java:74)
 at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:551)


This exception occurs often when I have the prefetch count > 1 but close my consumer channel before I completely drain all messages in the client-side buffer. Is there any workaround to this problem? (Not closing the channel is not the answer I am seeking.)

Thanks,

Rac

Michael Klishin

unread,
Aug 2, 2014, 2:12:15 AM8/2/14
to Rac Lst, rabbitm...@googlegroups.com
On 2 August 2014 at 03:02:24, Rac Lst (fstl...@gmail.com) wrote:
> > Hello,
>
> In the 3.2.4 version of this client, there appears to be a concurrent
> bug on line 543 regarding the call to isOpen(). A return status
> of "true" does not appear to guarantee that the channel is really
> open which would result in the following exception being thrown:

In what file?  3.2.4 is 5 releases behind, have you tried 3.3.4?

> This exception occurs often when I have the prefetch count > 1
> but close my consumer channel before I completely drain all messages
> in the client-side buffer. Is there any workaround to this problem?
> (Not closing the channel is not the answer I am seeking.)

Do you have a small program that reproduces the issue at least most of the time?
--
MK

Staff Software Engineer, Pivotal/RabbitMQ
Reply all
Reply to author
Forward
0 new messages