You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 or config) 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:
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 &. And long running processes — like the dev server, or emacs for that matter — that don't process information from the standard input are perfect candidates to be executed as a background job.
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"$@"&whileread line ;do:donekill -KILL %%
This has the downside that if the background job exits, the script will still run...
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: