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
stripe listen process is orphaned (continues running) if parent process gets killed.
In development environment people often run stripe listen (with additional arguments) using wrapper scripts like foreman, forego, rails/rake tasks, etc. If those scripts are killed via kill -9 {script_pid} or sometimes kill {script_pid} - stripe listen will continue running as an orphan process.
foreman and others will properly handle SIGTERM kill {script_pid} (foreman kills child processes), but custom scripts and task runners like rails/rake (and others) will not.
Steps to reproduce
Example script foo:
#!/usr/bin/env bashecho"Script pid is $$"
stripe listen
Make the script executable chmod +x foo
Run the script ./foo, note script pid in the output
Check stripe listen is running: command ps -ef | grep 'stripe listen' should output pid and command
Kill the parent script ./foo via kill {foo pid from step 2}
The output of ps -ef | grep 'stripe listen' will show stripe listen is still running. This is not expected, and not wanted.
Expected Behavior
I would expect that long running stripe command like stripe listen will end if parent died.
Traceback
N/A
Environment
Tested on macOS Ventura 13.4, but I suspect this is applicable to any other OS. stripe version 1.19.4
Comments
tailwindcss-cli had the same problem. They solved it by ending the process if stdin gets closed see commit (by Jose Valim!).
Issue
stripe listen
process is orphaned (continues running) if parent process gets killed.In development environment people often run
stripe listen
(with additional arguments) using wrapper scripts like foreman, forego, rails/rake tasks, etc. If those scripts are killed viakill -9 {script_pid}
or sometimeskill {script_pid}
-stripe listen
will continue running as an orphan process.foreman
and others will properly handle SIGTERMkill {script_pid}
(foreman kills child processes), but custom scripts and task runners like rails/rake (and others) will not.Steps to reproduce
foo
:chmod +x foo
./foo
, note script pid in the outputstripe listen
is running: commandps -ef | grep 'stripe listen'
should output pid and command./foo
viakill {foo pid from step 2}
ps -ef | grep 'stripe listen'
will showstripe listen
is still running. This is not expected, and not wanted.Expected Behavior
I would expect that long running stripe command like
stripe listen
will end if parent died.Traceback
N/A
Environment
Tested on macOS Ventura 13.4, but I suspect this is applicable to any other OS.
stripe version 1.19.4
Comments
tailwindcss-cli
had the same problem. They solved it by ending the process ifstdin
gets closed see commit (by Jose Valim!).Then they had another problem with this approach which they solved by adding an argument to not end the process if stdin gets closed.
I also work with
tailwindcss-cli
(run it from scripts, etc) and I can say the behavior of their command is good, and pretty much expected.The text was updated successfully, but these errors were encountered: