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

Foreman does not properly kill long-running processes #45

Closed
filiptibell opened this issue Mar 5, 2022 · 3 comments · Fixed by #81
Closed

Foreman does not properly kill long-running processes #45

filiptibell opened this issue Mar 5, 2022 · 3 comments · Fixed by #81

Comments

@filiptibell
Copy link

filiptibell commented Mar 5, 2022

Spawning a long running process in the terminal such as rojo serve and hitting Ctrl+C does not properly kill the process, it just leaves it hanging. This means that commands that bind to an address, such as the above, will not work at all after the first run.
I'm getting this issue using foreman v1.0.3 and macOS 12.3 on an M1 MacBook Pro 14''.

I was told that applying a patch similar to this one (LPGhatguy/aftman@1842a95) would solve the issue, however it seems like foreman already uses CommandGroup (since 7a037d9) so this might be a separate issue 🤔

A workaround for now is to use something like Activity Monitor, find and force-kill the spawned process, or to reboot.

Edit:

I had a suspicion that it might have been because of my shell (nushell) so I went and checked bash, zsh, fish, and they all behave the same. I also tried different terminals with each: VSCode built-in, hyper, terminal.app, same behavior for all there as well.

@FxllenCode
Copy link

+1 on the issue here.

Running Zorin OS 6, (based on Ubuntu 20.04) so I have bash as my shell. Ctrl + C does not kill the process at all, and this only happens with rojo installed via foreman. I can easily kill a Rust program through SigInt but it does not work with Rojo. My Foreman version is v1.0.3, bash version version 5.0.17(1)-release (x86_64-pc-linux-gnu).

Running ss -tunlp | grep 34872 after running rojo serve shows that the process was not ended:

image

This is a pretty frustrating bug as I have multiple different *.project.json files and often need to stop serving once so I can then serve with a different project.json.

It's pretty strange bug here and I assume it's because of multi-layer process running, not too sure though (not an expert to say the least).

@tacheometry
Copy link

I get the same issue as well, and I'm using bash. After running rojo serve I have to run pkill rojo to be able to run the command again.

@filiptibell
Copy link
Author

Turns out this is simply due to how unix-like OSes handle subprocesses, the issue has been solved in LPGhatguy/aftman@d3f8d1f and foreman would need to do something similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants