Skip to content

Commit

Permalink
Handle a couple of concurrent QQ deletion cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
kjnilsson committed Nov 28, 2024
1 parent 0fd318f commit b6c2e19
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 6 additions & 2 deletions deps/rabbit/src/rabbit_channel.erl
Original file line number Diff line number Diff line change
Expand Up @@ -657,10 +657,14 @@ handle_cast(terminate, State = #ch{cfg = #conf{writer_pid = WriterPid}}) ->
ok = rabbit_writer:flush(WriterPid),
{stop, normal, State};

handle_cast({command, #'basic.consume_ok'{consumer_tag = CTag} = Msg}, State) ->
handle_cast({command, #'basic.consume_ok'{consumer_tag = CTag} = Msg},
#ch{consumer_mapping = CMap} = State)
when is_map_key(CTag, CMap) ->
ok = send(Msg, State),
noreply(consumer_monitor(CTag, State));

handle_cast({command, #'basic.consume_ok'{}}, State) ->
%% a consumer was not found so just ignore this
noreply(State);
handle_cast({command, Msg}, State) ->
ok = send(Msg, State),
noreply(State);
Expand Down
6 changes: 6 additions & 0 deletions deps/rabbit/src/rabbit_fifo_client.erl
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,15 @@ enqueue(QName, Correlation, Msg,
%% it is safe to reject the message as we never attempted
%% to send it
{reject_publish, State0};
{error, {{shutdown, delete}, _Stack}} ->
rabbit_log:debug("~ts: QQ ~ts tried to register enqueuer during delete shutdown",
[?MODULE, rabbit_misc:rs(QName)]),
{reject_publish, State0};
{timeout, _} ->
{reject_publish, State0};
Err ->
rabbit_log:debug("~ts: QQ ~ts error when registering enqueuer ~p",
[?MODULE, rabbit_misc:rs(QName), Err]),
exit(Err)
end;
enqueue(_QName, _Correlation, _Msg,
Expand Down

0 comments on commit b6c2e19

Please sign in to comment.