Skip to content

Commit f843314

Browse files
dumbbellmichaelklishin
authored andcommitted
rabbitmq_federation: Handle shutdown from upstream
[Why] The downstream process was already handling a `{shutdown, Term}` termination reason from upstream gracefully: it would log a message an close the connection. However it didn't handle the more common `shutdown` reason, which happens with a regular stop of the upstream node. It led to the log of a giant scary crash message. [How] We handle `shutdown` the same as `{shutdown, Term}`.
1 parent 0a35255 commit f843314

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

deps/rabbitmq_federation/src/rabbit_federation_link_util.erl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ handle_downstream_down(Reason, _Args, State) ->
262262

263263
%% If the upstream channel goes down for an intelligible reason, just
264264
%% log it and die quietly.
265+
handle_upstream_down(shutdown, {Upstream, UParams, XName}, State) ->
266+
rabbit_federation_link_util:connection_error(
267+
remote, {upstream_channel_down, shutdown}, Upstream, UParams, XName, State);
265268
handle_upstream_down({shutdown, Reason}, {Upstream, UParams, XName}, State) ->
266269
rabbit_federation_link_util:connection_error(
267270
remote, {upstream_channel_down, Reason}, Upstream, UParams, XName, State);

0 commit comments

Comments
 (0)