archethic-node icon indicating copy to clipboard operation
archethic-node copied to clipboard

Bootstrap Task is not restarted when previous Supervisor crashes

Open Neylix opened this issue 10 months ago • 0 comments

Describe the problem you discovered

When the Application starts, there is a first supervisor Archethic.Supervisor which starts all the other supervisors with a rest_for_one strategy. This means if a supervisor crashes all the supervisor after in the children list are also restarted. But the Bootstrap child is not a GenServer but a Task, so as the Task is already finished, the supervisor will not restart it. This causes problem since some actions in this Task (mainly in post_bootstrap function) are needed by the node to work properly.

Describe the solution you'd like

The Bootstrap process in the Archethic.Supervisor children should be a GenServer so it could be restarted when a previous Supervisor crashes. Also this GenServer could have a terminate callback that make the persitent term archethic_up to down and notify it through the PubSub, so the node goes offline until all Supervisor are Restarted.

Epic

No response

Neylix avatar Mar 29 '24 10:03 Neylix