Skip to content

Commit 18e4bf6

Browse files
Merge pull request #14555 from lukebakken/lukebakken/fix-format-status-followup
Correctly implement `format_state/1` in `rabbit_priority_queue`
2 parents b819507 + 9c90e85 commit 18e4bf6

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

deps/rabbit/src/rabbit_priority_queue.erl

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -665,11 +665,15 @@ zip_msgs_and_acks(Pubs, AckTags) ->
665665
{Id, AckTag}
666666
end, Pubs, AckTags).
667667

668-
format_state(S = #passthrough{bq = BQ, bqs = BQS0}) ->
668+
format_state(State = #state{bq = BQ, bqss = BQSs0}) when is_list(BQSs0) ->
669669
case erlang:function_exported(BQ, format_state, 1) of
670670
true ->
671-
BQS1 = BQ:format_state(BQS0),
672-
S#passthrough{bqs = BQS1};
671+
BQSs1 = foreach1(fun (_Priority, BQSN) ->
672+
BQ:format_state(BQSN)
673+
end, State),
674+
State#state{bqss = BQSs1};
673675
_ ->
674-
S#passthrough{bqs = passthrough_bqs_truncated}
675-
end.
676+
State#state{bqss = bqss_truncated}
677+
end;
678+
format_state(State = #passthrough{bq = BQ, bqs = BQS}) ->
679+
?passthrough1(format_state(BQS)).

0 commit comments

Comments
 (0)