Skip to content

Commit

Permalink
[NOD-869] Add a print after os.Exit(1) to see if it is ever called (#701
Browse files Browse the repository at this point in the history
)
  • Loading branch information
svarogg committed Apr 22, 2020
1 parent 3fd647b commit c888697
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion util/panics/panics.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func HandlePanic(log *logs.Logger, goroutineStackTrace []byte) {
log.Criticalf("Goroutine stack trace: %s", goroutineStackTrace)
}
log.Criticalf("Stack trace: %s", debug.Stack())

log.Backend().Close()
close(panicHandlerDone)
}()
Expand All @@ -34,8 +35,9 @@ func HandlePanic(log *logs.Logger, goroutineStackTrace []byte) {
fmt.Fprintln(os.Stderr, "Couldn't handle a fatal error. Exiting...")
case <-panicHandlerDone:
}
log.Criticalf("Exiting")
fmt.Print("Exiting...")
os.Exit(1)
fmt.Print("After os.Exit(1)")
}

// GoroutineWrapperFunc returns a goroutine wrapper function that handles panics and writes them to the log.
Expand Down

0 comments on commit c888697

Please sign in to comment.