make profiling work again
The weave SIGINT signal handler was racing the profiler SIGINT signal handler. So now we a) make the former return instead of exit, and b) disable the latter, as a result of which the deferred profile.Stop in weaver/main gets called.
This commit is contained in:
1 parent
43133b5851
commit
03c1f49850
2 files changed
+2
-1
No files matched your search
+1
-1
@@ -24,7 +24,7 @@ func SignalHandlerLoop(ss ...SignalReceiver) {
|
||||
for _, subsystem := range ss {
|
||||
subsystem.Stop()
|
||||
}
|
||||
os.Exit(0)
|
||||
return
|
||||
case syscall.SIGQUIT:
|
||||
stacklen := runtime.Stack(buf, true)
|
||||
Info.Printf("=== received SIGQUIT ===\n*** goroutine dump...\n%s\n*** end\n", buf[:stacklen])
|
||||
|
||||
@@ -112,6 +112,7 @@ func main() {
|
||||
if prof != "" {
|
||||
p := *profile.CPUProfile
|
||||
p.ProfilePath = prof
|
||||
p.NoShutdownHook = true
|
||||
defer profile.Start(&p).Stop()
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user