When printing call-stacks from SIGQUIT, trim the buffer to remove garbage at the end
This commit is contained in:
1 parent
24bd0a9a75
commit
404c7a1ad4
1 file changed
+2
-2
+2
-2
@@ -168,8 +168,8 @@ func handleSignals(router *weave.Router) {
|
||||
sig := <-sigs
|
||||
switch sig {
|
||||
case syscall.SIGQUIT:
|
||||
runtime.Stack(buf, true)
|
||||
log.Printf("=== received SIGQUIT ===\n*** goroutine dump...\n%s\n*** end\n", buf)
|
||||
stacklen := runtime.Stack(buf, true)
|
||||
log.Printf("=== received SIGQUIT ===\n*** goroutine dump...\n%s\n*** end\n", buf[:stacklen])
|
||||
case syscall.SIGUSR1:
|
||||
log.Printf("=== received SIGUSR1 ===\n*** status...\n%s\n*** end\n", router.Status())
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user