[rabbitmq-discuss] Rabbitmq 2.5-2.6.1 java hanging on close of connection

Benjamin Bennett benbennett at gmail.com
Thu Nov 17 18:12:00 GMT 2011


Had a question if no one is working on patch for the java client do
accept external patches?

I was going to either change it to the following .

1) Remove the infinite wait on a connection close.

Or

Place a BlockingQueue on the channel closes during the close call.

The sychronize on the BlockingQueue for the connection close  , of
which it cannot close the connection if a channel is currently be
closed.

The second is more code but it would keep the infinity timeout in
place will working around the deadlock issue.

It would save a lot of pain if people are using 2.7.1 and below.

On Mon, Nov 14, 2011 at 5:21 PM, Benjamin Bennett <benbennett at gmail.com> wrote:
> I am using the spring amqp lib and it is doing the connection closing when
> the spring context is closed. I do not think it has a property to inject the
> hack. Also if you know any of the spring amqp devs. Having you telling them
> to check to make sure it is doing the way you have described will have much
> more authority than me.
>
> I will probably hack the spring amqp lib for now
>
> On Nov 14, 2011 12:32 PM, "Simon MacMullen" <simon at rabbitmq.com> wrote:
>>
>> On 14/11/11 16:15, Benjamin Bennett wrote:
>>>
>>> Here is report from  rabbitmqctrl report
>>> http://pastebin.com/MSwv82C3
>>
>> Ah, thank you. After some poking, that genuinely looks like a server bug.
>> Damn.
>>
>> In order for it to happen you need the last channel close / close_ok to
>> overlap with the connection close / close_ok. With the Java client you have
>> to invoke Channel.close() and Connection.close() from different threads to
>> get this to happen, and still be unlucky.
>>
>> You should be allowed to do this, but right now it's racy.
>>
>> > I was going to attempt to put a timeout on the connection close method
>> > but that really would be a hack.
>>
>> Indeed! Other slightly less hacky workarounds until we get this fixed:
>>
>> * Invoke Channel.close() and Connection.close() from the same thread, or
>> otherwise ensure they don't overlap.
>>
>> * Don't invoke Channel.close() if you know you're going to invoke
>> Connection.close() anyway.
>>
>> Cheers, Simon
>>
>> --
>> Simon MacMullen
>> RabbitMQ, VMware
>> _______________________________________________
>> rabbitmq-discuss mailing list
>> rabbitmq-discuss at lists.rabbitmq.com
>> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>


More information about the rabbitmq-discuss mailing list