Skip to content

Propagate SIGINFO to all processes - #150

Merged
DarthSim merged 2 commits into
DarthSim:masterfrom
joeytepp:siginfo
Mar 10, 2023
Merged

DarthSim merged 2 commits into
DarthSim:masterfrom
joeytepp:siginfo

Conversation

@joeytepp

@joeytepp joeytepp commented Feb 21, 2023 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

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

@iyaz-shaikh iyaz-shaikh left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM!

Comment thread start/process.go

const runningCheckInterval = 100 * time.Millisecond

const SIGINFO syscall.Signal = 29

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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