Skip to content

Commit 9ed93f8

Browse files
committed
fix
1 parent f6dde23 commit 9ed93f8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

deps/rabbit/src/rabbit_fifo_client.erl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -728,8 +728,6 @@ handle_ra_event(QName, _, timeout, #state{cfg = #cfg{servers = Servers},
728728
pending = Pending} = State0) ->
729729
case find_leader(Servers) of
730730
undefined ->
731-
?LOG_DEBUG("~ts: ~s Pending applied Timeout, no leader found, num pend ~b ",
732-
[rabbit_misc:rs(QName), ?MODULE, maps:size(Pending)]),
733731
%% still no leader, set the timer again
734732
{ok, set_timer(QName, State0), []};
735733
Leader ->
@@ -812,12 +810,16 @@ seq_applied({Seq, Response},
812810
{Corrs, Actions0, #state{} = State0}) ->
813811
%% sequences aren't guaranteed to be applied in order as enqueues are
814812
%% low priority commands and may be overtaken by others with a normal priority.
813+
%%
814+
%% if the response is 'not_enqueued' we need to still keep the pending
815+
%% command for a later resend
815816
{Actions, State} = maybe_add_action(Response, Actions0, State0),
816817
case maps:take(Seq, State#state.pending) of
817-
{{undefined, _}, Pending} ->
818+
{{undefined, _}, Pending}
819+
when Response =/= not_enqueued ->
818820
{Corrs, Actions, State#state{pending = Pending}};
819821
{{Corr, _}, Pending}
820-
when Response /= not_enqueued ->
822+
when Response =/= not_enqueued ->
821823
{[Corr | Corrs], Actions, State#state{pending = Pending}};
822824
_ ->
823825
{Corrs, Actions, State}

0 commit comments

Comments
 (0)