Skip to content

Commit 39efa14

Browse files
the-mikedavismergify[bot]
authored andcommitted
rabbit_db_exchange: Allow infinite timeout for serial updates in Khepri
It's unlikely that these operations will time out since the serial number is always updated after some other transaction, for example adding or deleting an exchange. In the future we could consider moving the serial updates into those transactions. In the meantime we can remove the possibility of timeouts by giving the serial update unlimited time to finish. (cherry picked from commit 7059582)
1 parent e01d938 commit 39efa14

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

deps/rabbit/src/rabbit_db_exchange.erl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -524,17 +524,15 @@ next_serial_in_khepri(XName) ->
524524
UpdatePath =
525525
khepri_path:combine_with_conditions(
526526
Path, [#if_payload_version{version = Vsn}]),
527-
case rabbit_khepri:put(UpdatePath, Serial + 1) of
527+
case rabbit_khepri:put(UpdatePath, Serial + 1, #{timeout => infinity}) of
528528
ok ->
529529
Serial;
530530
{error, {khepri, mismatching_node, _}} ->
531-
next_serial_in_khepri(XName);
532-
Err ->
533-
Err
531+
next_serial_in_khepri(XName)
534532
end;
535533
_ ->
536534
Serial = 1,
537-
ok = rabbit_khepri:put(Path, Serial + 1),
535+
ok = rabbit_khepri:put(Path, Serial + 1, #{timeout => infinity}),
538536
Serial
539537
end.
540538

0 commit comments

Comments
 (0)