cyberark / secretless-broker

Secure your apps by making them Secretless
Apache License 2.0
234 stars 40 forks source link

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

Open maciek01 opened 3 years ago

maciek01 commented 3 years ago

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