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

Closed
rustyx opened this issue Jul 25, 2019 · 2 comments
Closed

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

rustyx opened this issue Jul 25, 2019 · 2 comments

Comments

@rustyx
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.

@Freeaqingme

This comment has been minimized.

Copy link

@Freeaqingme Freeaqingme commented Jul 25, 2019

quote from Wikipedia:

SIGQUIT
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.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.