Open ajayvigneshk opened 2 years ago
In Chapter 09, section 9.1, the following code on iex
Todo.System.start_link Process.exit(Process.whereis(Todo.ProcessRegistry),:kill)
causes the Supervisor to crash(after trying to restart the children). Trying to inspect the result of Registry.start_link, it shows
Registry.start_link
{:error, {:shutdown, {:failed_to_start_child, Todo.ProcessRegistry.PIDPartition0, {:already_started, #PID<0.183.0>}}}}
Am guessing that this happens because the supervisor is starting ProcessRegistry in succession before the actual Registry is shutdown and keeps erroring 3 times, ending up in shutdown. Is that correct? How to handle this scenario gracefully?
ProcessRegistry
Registry
In Chapter 09, section 9.1, the following code on iex
causes the Supervisor to crash(after trying to restart the children). Trying to inspect the result of
Registry.start_link
, it showsAm guessing that this happens because the supervisor is starting
ProcessRegistry
in succession before the actualRegistry
is shutdown and keeps erroring 3 times, ending up in shutdown. Is that correct? How to handle this scenario gracefully?