Closed DohanKim closed 7 months ago
Great find, thank you! I will review this weekend.
Sorry, the original code doesn't necessarily crash the whole app as we are using supervisor hierarchy. But still, this can cause unexpected behavior when a direct child is terminated.
Are you running on more than one node?
@cpursley no, running only 1 node
We are overriding WalEx supervisor's child_spec without setting
type
key which makes the type as default:worker
instead of:supervisor
( https://hexdocs.pm/elixir/1.12/Supervisor.html#module-child-specification )can check it by running
shows
This makes the whole app crash whenever any of the Event modules or other WalEx processes crashes.
we have choices of
type: :supervisor
I chose the latter as there is no significant reason to override the child_spec.