Skip to content

Commit 130bccc

Browse files
committed
cmd/utils: flush trace and CPU profile data when force-qutting
Also reduce log messages a little bit.
1 parent ae9ed5c commit 130bccc

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

cmd/utils/cmd.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,13 @@ func StartNode(stack *node.Node) {
7373
<-sigc
7474
glog.V(logger.Info).Infoln("Got interrupt, shutting down...")
7575
go stack.Stop()
76-
logger.Flush()
7776
for i := 10; i > 0; i-- {
7877
<-sigc
7978
if i > 1 {
80-
glog.V(logger.Info).Infoln("Already shutting down, please be patient.")
81-
glog.V(logger.Info).Infoln("Interrupt", i-1, "more times to induce panic.")
79+
glog.V(logger.Info).Infof("Already shutting down, interrupt %d more times for panic.", i-1)
8280
}
8381
}
84-
glog.V(logger.Error).Infof("Force quitting: this might not end so well.")
82+
debug.Exit() // ensure trace and CPU profile data is flushed.
8583
debug.LoudPanic("boom")
8684
}()
8785
}

0 commit comments

Comments
 (0)