-
Notifications
You must be signed in to change notification settings - Fork 2
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
[fix] Explicitly expire child processes of a Task.Supervisor #1873
Conversation
Coverage of commit
|
Should the fallback for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go, just need that one change to the exit reason in order to force the process to stop.
@cmaddox5 Sure! I lost sight of that once we found the more realistic bug. I'm having trouble thinking through the erlang process driven logic. Would this just be adding a direct call to |
I think it might be safer to get the |
Ooohhh of course it returns a pid. Ok ✍️ |
Co-authored-by: Jon Zimbel <[email protected]>
Coverage of commit
|
@@ -48,6 +48,7 @@ defmodule Screens.OlCrowding.DynamicSupervisor do | |||
restart: :transient | |||
} | |||
|
|||
DynamicSupervisor.start_child(__MODULE__, spec) | |||
{:ok, child_pid} = DynamicSupervisor.start_child(__MODULE__, spec) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to avoid crashing the app when one of these fails to start, can this be handled in a case
instead and if the result is anything but {:ok, child_pid}
we can just fail silently (or with a log, up to you on that)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmmm mmhmm 👍 👍
Coverage of commit
|
Coverage of commit
|
Child processes of Task.Supervisors do not expire, even if they are meant to be temporary. We need to explicitly end the process if it's running too long. At the moment, the timeout is set for 10s.