Skip to content

Orphan process(es) #1176

@bruno-

Description

@bruno-

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions