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

Propagate SIGINFO to all processes #150

Merged
merged 2 commits into from
Mar 10, 2023
Merged

Conversation

joeytepp
Copy link
Contributor

@joeytepp joeytepp commented Feb 21, 2023

NOTE: This only works on MacOS since there is no SIGINFO signal on Linux. See golang/go#1653

My team has been using overmind for a while now and 1 thing that's been missing for us has been the propagation of the SIGINFO signal. One of our processes traps SIGINFOs (through ctrl + t) when run in isolation, however when using overmind this no longer works. This change would propagate the SIGINFO signal to all overmind processes which would allow for each process to handle the signal itself.

You could test locally this by creating the following Procfile at the root of your folder

test: sleep 10000

and then running go build && ./overmind start. After this press ctrl + t to trigger info and verify that you get the output of the SIGINFO signal on the sleep process. It should look something like

load: 8.65  cmd: tmux 59513 waiting 0.00u 0.00s
test   | sleep: about 9998 second(s) left out of the original 10000

@joeytepp
Copy link
Contributor Author

@DarthSim would greatly appreciate a review on this when you have the time 🙏

Copy link

@iyaz-shaikh iyaz-shaikh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@@ -11,6 +11,8 @@ import (

const runningCheckInterval = 100 * time.Millisecond

const SIGINFO syscall.Signal = 29
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to do this since syscall.SIGINFO isn't defined in go on Linux, see golang/go#1653

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alternative would be to create separate files with build tags for linux and darwin, but this seemed like a much simpler approach

@DarthSim DarthSim merged commit cee81ac into DarthSim:master Mar 10, 2023
@DarthSim
Copy link
Owner

Hey @joeytepp!
This looks nice, thanks for your contribution!

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 this pull request may close these issues.

3 participants