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

provide ability to intercept sigquit (kill -3) to generate current execution stack snapshots for all active tasks #1403

Open
maciek01 opened this issue Apr 20, 2021 · 0 comments

Comments

@maciek01
Copy link

Is your feature request related to a problem? Please describe.

I would like to see stack traces for all threads/tasks in a go process in order to troubleshoot 'hang' or timingout execution of go functions within secretless.

Describe the solution you would like

provide ability to intercept sigquit (kill -3) to generate current execution stack snapshots for all active tasks

example:

https://stackoverflow.com/questions/19094099/how-to-dump-goroutine-stacktraces

import ("runtime"
"os"
"os/signal"
"syscall"
)

go func() {
sigs := make(chan os.Signal, 1)
signal.Notify(sigs, syscall.SIGQUIT)
buf := make([]byte, 1<<20)
for {
<-sigs
stacklen := runtime.Stack(buf, true)
log.Printf("=== received SIGQUIT ===\n*** goroutine dump...\n%s\n*** end\n", buf[:stacklen])
}
}()

Describe alternatives you have considered

this is a request for specific handling of kill -3 in a golang process

Additional context

https://cyberark.lightning.force.com/lightning/r/Case/5002J00001QniPpQAJ/view

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

No branches or pull requests

1 participant