+rabbitmq-server (3.5.6-1~u14.04+mos4) mos8.0; urgency=medium
+
+ * Backport https://github.com/rabbitmq/rabbitmq-common/pull/26
+
+ -- Alexey Lebedeff <alebedev@mirantis.com> Thu, 24 Dec 2015 14:28:56 +0300
+
rabbitmq-server (3.5.6-1~u14.04+mos3) mos8.0; urgency=medium
* Backport https://github.com/rabbitmq/rabbitmq-management/pull/84
--- /dev/null
+Description: Detect infinite loop in AMQP channel code
+ Sudden death of cluster node could result in a stuck queue process - this will result in
+ redeclare attempts to hang. With this patch such condition will be detected - AMQP channel will
+ be closed and error will be logged. And probably it could help us to discover underlying bug, by
+ localizing the event in time.
+Author: Alexey Lebedeff <alebedev@mirantis.com>
+Origin: upstream, https://github.com/rabbitmq/rabbitmq-common/pull/26
+Bug:https://github.com/rabbitmq/rabbitmq-server/issues/349
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/src/rabbit_amqqueue.erl
++++ b/src/rabbit_amqqueue.erl
+@@ -385,6 +385,11 @@ not_found_or_absent_dirty(Name) ->
+ end.
+
+ with(Name, F, E) ->
++ with(Name, F, E, 2000).
++
++with(Name, _F, E, 0) ->
++ E(not_found_or_absent_dirty(Name));
++with(Name, F, E, RetriesLeft) ->
+ case lookup(Name) of
+ {ok, Q = #amqqueue{state = crashed}} ->
+ E({absent, Q, crashed});
+@@ -397,8 +402,8 @@ with(Name, F, E) ->
+ %% the retry loop.
+ rabbit_misc:with_exit_handler(
+ fun () -> false = rabbit_mnesia:is_process_alive(QPid),
+- timer:sleep(25),
+- with(Name, F, E)
++ timer:sleep(30),
++ with(Name, F, E, RetriesLeft - 1)
+ end, fun () -> F(Q) end);
+ {error, not_found} ->
+ E(not_found_or_absent_dirty(Name))