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

Orphan process(es) #1176

Open
bruno- opened this issue May 1, 2024 · 0 comments
Open

Orphan process(es) #1176

bruno- opened this issue May 1, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@bruno-
Copy link

bruno- commented May 1, 2024

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 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 bash

echo "Script pid is $$"

stripe listen
  1. Make the script executable chmod +x foo
  2. Run the script ./foo, note script pid in the output
  3. Check stripe listen is running: command ps -ef | grep 'stripe listen' should output pid and command
  4. Kill the parent script ./foo via kill {foo pid from step 2}
  5. 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!).

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.

@bruno- bruno- added the bug Something isn't working label May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant