Skip to content

Commit 9ef3e3e

Browse files
committed
Add auto_shutdown => any_significant to rabbit_fifo_dlx_worker_sup
When the DLX worker exits gracefully (e.g., `{shutdown, queue_leader_down}` on leadership change), a `transient` child is not restarted and does not trip the intensity counter. Without `auto_shutdown`, the worker_sup survives as an empty orphan under the sup_sup. Marking the worker as `significant => true` and the supervisor as `auto_shutdown => any_significant` ensures the worker_sup self-terminates when its worker exits gracefully. Same pattern as `rabbit_channel_sup`.
1 parent b48e85c commit 9ef3e3e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

deps/rabbit/src/rabbit_fifo_dlx_worker_sup.erl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ init([QRef]) ->
2121
DlxWorkerSupPid = self(),
2222
SupFlags = #{strategy => one_for_one,
2323
intensity => 0,
24-
period => 1},
24+
period => 1,
25+
auto_shutdown => any_significant},
2526
ChildSpec = #{id => rabbit_fifo_dlx_worker,
2627
start => {rabbit_fifo_dlx_worker, start_link, [QRef, DlxWorkerSupPid]},
2728
type => worker,
2829
restart => transient,
30+
significant => true,
2931
shutdown => 5000},
3032
{ok, {SupFlags, [ChildSpec]}}.

0 commit comments

Comments
 (0)