Print stack trace of all goroutines when emergency halting if verbose
This commit is contained in:
parent
02f06d857e
commit
126374fbac
@ -6,6 +6,7 @@ import "log"
|
||||
import "io/fs"
|
||||
import "errors"
|
||||
import "context"
|
||||
import "runtime"
|
||||
import "strings"
|
||||
import "path/filepath"
|
||||
import "git.tebibyte.media/sashakoshka/go-cli"
|
||||
@ -273,6 +274,11 @@ func (this *environment) phase80Shutdown() bool {
|
||||
<- ctx.Done()
|
||||
if errors.Is(context.Cause(ctx), context.DeadlineExceeded) {
|
||||
log.Println("XXX (80) shutdown timeout expired, performing emergency halt")
|
||||
if Verb() {
|
||||
dumpBuffer := make([]byte, 8192)
|
||||
runtime.Stack(dumpBuffer, true)
|
||||
log.Printf("XXX (80) stack trace of all goroutines:\n%s", dumpBuffer)
|
||||
}
|
||||
log.Printf("====== [%s] END =======", this.name)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user