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

runtime: don't die after dumping goroutines on SIGQUIT #33282

rustyx opened this issue Jul 25, 2019 · 2 comments

runtime: don't die after dumping goroutines on SIGQUIT #33282

rustyx opened this issue Jul 25, 2019 · 2 comments


Copy link

@rustyx rustyx commented Jul 25, 2019

go version go1.10.3 linux/amd64

When sending a SIGQUIT to a running Go process:

  1. It dumps its goroutines to stderr (as addressed by #2516).
  2. It exits.

It would have been a much more useful feature if SIGQUIT didn't kill the Go process, but only dumped the goroutines (i.e. did # 1 but not # 2).

NB: Java works that way -- a SIGQUIT dumps the threads, and then the JVM continues running normally. You can dump threads as many times as you like without killing the process.

Copy link

@Freeaqingme Freeaqingme commented Jul 25, 2019

quote from Wikipedia:

The SIGQUIT signal is sent to a process by its controlling terminal when the user requests that the process quit and perform a core dump.

The name sigquit really implies to me that the primary objective is to quit, the core dump is an added bonus.

Also, java isn't always the best point of reference. Java probably did a lot of things right, but may have also accumulated some behavior that's suboptimal in hindsight.

Copy link

@ianlancetaylor ianlancetaylor commented Jul 25, 2019

Making that change at this point would break too many people's operating procedures, so we aren't going to implement it as written. I'm going to close this issue. Please comment if you disagree.

You can implement this general idea yourself using the os/signal package and the runtime.Stack function.

@golang golang locked and limited conversation to collaborators Jul 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.