Skip to content

Commit 1d361db

Browse files
committed
fix: start gate before registry in supervision tree
The registry init calls nova_resilience_gate:deps_provisioned() (a gen_server cast), but the gate process hadn't started yet since it was second in the child list. The cast was silently dropped, leaving the system permanently not-ready. Swapping the order ensures the gate is alive when the registry sends the deps_provisioned notification.
1 parent f5886b2 commit 1d361db

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/nova_resilience_sup.erl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Top-level supervisor for nova_resilience.
66
Supervision tree:
77
```
88
nova_resilience_sup (one_for_one)
9-
├── nova_resilience_registry (gen_server)
10-
└── nova_resilience_gate (gen_server)
9+
├── nova_resilience_gate (gen_server)
10+
└── nova_resilience_registry (gen_server)
1111
```
1212
""".
1313

@@ -22,14 +22,14 @@ start_link() ->
2222
init([]) ->
2323
Children = [
2424
#{
25-
id => nova_resilience_registry,
26-
start => {nova_resilience_registry, start_link, []},
25+
id => nova_resilience_gate,
26+
start => {nova_resilience_gate, start_link, []},
2727
shutdown => 5000,
2828
type => worker
2929
},
3030
#{
31-
id => nova_resilience_gate,
32-
start => {nova_resilience_gate, start_link, []},
31+
id => nova_resilience_registry,
32+
start => {nova_resilience_registry, start_link, []},
3333
shutdown => 5000,
3434
type => worker
3535
}

0 commit comments

Comments
 (0)