-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Wachers process that I use in dev
environment aren't killed when I kill my app by Ctrl-C
#2215
Comments
It is not the responsibility of the Phoenix server to do so. Please make sure the webpack IS listening to stdin and shutting down when the stdin is closed. More information found here in the zomie process section: hexdocs.pm/elixir/Port.html |
To be honest I question this a little bit: if all processes watched stdin at all times, no process would be executable in the background with the shell On the other hand, I can see why we might want processes to do that in the context of the Erlang VM. But this model doesn't really fit the aforementioned tools. Also, to me the proposed workaround doesn't really work: it will still block on the long running process and it will not get the PID anyway. A better script would be: #!/bin/sh
"$@" &
while read line ; do
:
done
kill -KILL %% This has the downside that if the background job exits, the script will still run... |
I am able to use |
Environment
Expected behavior
I have a watcher in my
dev
environment which is a simplewebpack
builder with ability to--watch-stdin
.The problem is that when I stop phoenix server via
Ctrl-C
in my terminal this webpack process is still running. It's sad, especially if I know that every running instance decreases available RAM amount by 200MB.So, 5 restarts (if I edit something in my
lib
orconfig
) devours 1GB of memory! Is it a bug or feature? I thought that watcher processes should be killed too when I stop my phoenix server...The text was updated successfully, but these errors were encountered: