Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ch09] - ProcessRegistry restarts crash the App #23

Open
ajayvigneshk opened this issue Nov 21, 2021 · 0 comments
Open

[ch09] - ProcessRegistry restarts crash the App #23

ajayvigneshk opened this issue Nov 21, 2021 · 0 comments

Comments

@ajayvigneshk
Copy link

ajayvigneshk commented Nov 21, 2021

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

{: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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant