channel.queueDeclare() blocked indefinitely

414 views
Skip to first unread message

rahul gupta

unread,
May 25, 2015, 6:23:10 AM5/25/15
to rabbitm...@googlegroups.com
Hi, 

I am using RabbitMq version 3.2.4 and java amqp-client version 3.2.4.

I am stuck in an issue where a call to channel.queueDeclare() gets blocked indefinitely. It works fine on our dev-environments but gets stuck on another environment.

Below mentioned is the stack trace.

 - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
 - java.lang.Object.wait() @bci=2, line=502 (Interpreted frame)
 - com.rabbitmq.utility.BlockingCell.get() @bci=8, line=50 (Interpreted frame)
 - com.rabbitmq.utility.BlockingCell.uninterruptibleGet() @bci=1, line=89 (Interpreted frame)
 - com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue() @bci=1, line=33 (Interpreted frame)
 - com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply() @bci=4, line=343 (Interpreted frame)
 - com.rabbitmq.client.impl.AMQChannel.privateRpc(com.rabbitmq.client.Method) @bci=15, line=216 (Interpreted frame)
 - com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(com.rabbitmq.client.Method) @bci=2, line=118 (Interpreted frame)
 - com.rabbitmq.client.impl.ChannelN.queueDeclare(java.lang.String, boolean, boolean, boolean, java.util.Map) @bci=33, line=779 (Interpreted frame)
 - com.rabbitmq.client.impl.ChannelN.queueDeclare(java.lang.String, boolean, boolean, boolean, java.util.Map) @bci=8, line=61 (Interpreted frame)
 - org.springframework.amqp.rabbit.support.PublisherCallbackChannelImpl.queueDeclare(java.lang.String, boolean, boolean, boolean, java.util.Map) @bci=11, line=367 (Interpreted frame)
 - sun.reflect.NativeMethodAccessorImpl.invoke0(java.lang.reflect.Method, java.lang.Object, java.lang.Object[]) @bci=0 (Interpreted frame)
 - sun.reflect.NativeMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) @bci=87, line=57 (Interpreted frame)
 - sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) @bci=6, line=43 (Compiled frame)
 - java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) @bci=161, line=616 (Compiled frame)
 - org.springframework.amqp.rabbit.connection.CachingConnectionFactory$CachedChannelInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) @bci=311, line=548 (Interpreted frame)


Here is my java client code : 
                // connectionFactory -> CachingConnectionFactory
                org.springframework.amqp.rabbit.connection.Connection conn = connectionFactory.createConnection();
com.rabbitmq.client.Channel ch = conn.createChannel(false);

ch.queueDeclare(queueName, true, false, false, null);
ch.queueBind(queueName, exchange, queueName);
 

The same happens with queueDelete() as well.

Any pointers will be highly appreciated.

Regards, 
Rahul

Michael Klishin

unread,
May 25, 2015, 6:25:14 AM5/25/15
to rabbitm...@googlegroups.com, rahul gupta
On 25 May 2015 at 13:23:13, rahul gupta (rahu...@gmail.com) wrote:
> Any pointers will be highly appreciated.

Your connection was blocked by resource flow control:
http://www.rabbitmq.com/alarms.html

Later Java client versions allow you to define a connection.[un]blocked notification listener
and can be used with RabbitMQ server 3.2.x. 
--
MK

Staff Software Engineer, Pivotal/RabbitMQ


rahul gupta

unread,
May 25, 2015, 6:39:14 AM5/25/15
to rabbitm...@googlegroups.com, rahu...@gmail.com

Resource flow control seems to be triggered when RMQ is low on resources. In my case, I dont think the issue is because of low resources.

Rabbitmq is running on my local machine and there are enough resources available as can be seen from the below mentioned rabbitmq stats.

Connections: 4
Channels: 22
Exchanges: 9
Queues: 4
Consumers: 21

Nodes

NameFile descriptors (?)Socket descriptors (?)Erlang processesMemoryDisk spaceUptimeType
rabbit
40
50000 available
5
44908 available
338
1048576 available
74MB
48GB high watermark
136GB
48MB low watermark
3d 3hDisc Stats *

Please suggest if I am missing out on something.

Regards, 
Rahul

Michael Klishin

unread,
May 25, 2015, 8:13:45 AM5/25/15
to rabbitm...@googlegroups.com, rahul gupta
On 25 May 2015 at 13:39:16, rahul gupta (rahu...@gmail.com) wrote:
> Resource flow control seems to be triggered when RMQ is low on
> resources. In my case, I dont think the issue is because of low
> resources.
>
> Rabbitmq is running on my local machine and there are enough resources
> available as can be seen from the below mentioned rabbitmq stats.

There is no need to guess, alarms will be pretty visible in RabbitMQ log.

Feel free to try a more recent Java client version, too. 

rahul gupta

unread,
May 26, 2015, 5:18:34 AM5/26/15
to rabbitm...@googlegroups.com, rahu...@gmail.com
There was no alarm in rabbitMq logs.

However, the issue got resolved with a rabbitmq restart. The issue hasn't made an appearance since then.

Thanks for your help.

Tomoyo

unread,
Sep 25, 2016, 9:24:44 AM9/25/16
to rabbitmq-users, rahu...@gmail.com

hello, brothers, i met the same problem as you. How did you solve the problem at last ?  

i will met the problem when i push a large rpc messages to rabbitmq sever,Probably 2 millions in ten hours.

 i don't think its work on low resources, too ,  I can't find the reason.


would you like to share with me ?


在 2015年5月26日星期二 UTC+8下午5:18:34,rahul gupta写道:

Michael Klishin

unread,
Sep 25, 2016, 10:36:07 AM9/25/16
to rabbitm...@googlegroups.com, rahu...@gmail.com
It is almost certainly a resource-driven flow control. See server logs and the docs.
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tomoyo

unread,
Sep 25, 2016, 11:05:08 AM9/25/16
to rabbitmq-users, rahu...@gmail.com
Michael :

first thank you for answering my question .

server logs have some errors like this  :
 
=ERROR REPORT==== 24-Sep-2016::01:46:41 ===
closing AMQP connection <0.23223.1101> (172.17.194.212:51378 -> 172.17.194.213:5675):
{handshake_timeout,frame_header}

rabbit docs in https://www.rabbitmq.com/alarms.html introduce flow control will reduce the speed of connections which are publishing too quickly for queues to keep up .

this means i should improve server performance ? or use a separate server to deal with different kinds of queues, or to configure a cluster to solve this problem ?


在 2016年9月25日星期日 UTC+8下午10:36:07,Michael Klishin写道:
Reply all
Reply to author
Forward
0 new messages