Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP Supervise rabbit_fifo_dlx_worker
Start worker when Ra node becomes leader. Stop worker when Ra node is not leader anymore. Next step: Currently the state_enter callbacks are called for rabbit_fifo_v0. Only after the node becomes leader, "applying new machine version 2 current 0". Check why that's the case.
- Loading branch information
Showing
5 changed files
with
95 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
-module(rabbit_fifo_dlx_sup). | ||
|
||
-behaviour(supervisor). | ||
|
||
-rabbit_boot_step({?MODULE, | ||
[{description, "supervisor of quorum queue dead-letter workers"}, | ||
{mfa, {rabbit_sup, start_supervisor_child, [?MODULE]}}, | ||
{requires, routing_ready}]}). | ||
|
||
%% supervisor callback | ||
-export([init/1]). | ||
%% client API | ||
-export([start_link/0]). | ||
|
||
start_link() -> | ||
supervisor:start_link({local, ?MODULE}, ?MODULE, []). | ||
|
||
init([]) -> | ||
FeatureFlag = quorum_queue, | ||
case rabbit_ff_registry:is_enabled(FeatureFlag) of | ||
true -> | ||
SupFlags = #{strategy => simple_one_for_one, | ||
intensity => 0, | ||
period => 1}, | ||
Worker = rabbit_fifo_dlx_worker, | ||
ChildSpec = #{id => Worker, | ||
start => {Worker, start_link, []}, | ||
type => worker, | ||
modules => [Worker]}, | ||
{ok, {SupFlags, [ChildSpec]}}; | ||
false -> | ||
rabbit_log:info("not starting supervisor ~s because feature flag ~s is disabled", | ||
[?MODULE, FeatureFlag]), | ||
ignore | ||
end. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters