Skip to content

Commit a1ed8e9

Browse files
committed
Handle a couple of concurrent QQ deletion cases.
1 parent 0fd318f commit a1ed8e9

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

deps/rabbit/src/rabbit_channel.erl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,10 +657,14 @@ handle_cast(terminate, State = #ch{cfg = #conf{writer_pid = WriterPid}}) ->
657657
ok = rabbit_writer:flush(WriterPid),
658658
{stop, normal, State};
659659

660-
handle_cast({command, #'basic.consume_ok'{consumer_tag = CTag} = Msg}, State) ->
660+
handle_cast({command, #'basic.consume_ok'{consumer_tag = CTag} = Msg},
661+
#ch{consumer_mapping = CMap} = State)
662+
when is_map_key(CTag, CMap) ->
661663
ok = send(Msg, State),
662664
noreply(consumer_monitor(CTag, State));
663-
665+
handle_cast({command, #'basic.consume_ok'{}}, State) ->
666+
%% a consumer was not found so just ignore this
667+
noreply(State);
664668
handle_cast({command, Msg}, State) ->
665669
ok = send(Msg, State),
666670
noreply(State);

deps/rabbit/src/rabbit_fifo_client.erl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ enqueue(QName, Correlation, Msg,
133133
%% it is safe to reject the message as we never attempted
134134
%% to send it
135135
{reject_publish, State0};
136+
{error, {{shutdown, delete}, _Stack}} ->
137+
rabbit_log:debug("~ts: QQ ~ts tried to register enqueuer during delete shutdown",
138+
[?MODULE, rabbit_misc:rs(QName)]),
139+
{reject_publish, State0};
136140
{timeout, _} ->
137141
{reject_publish, State0};
138142
Err ->

0 commit comments

Comments
 (0)