MM-27887: set traceback to crash from code (#15274)

Unless we set traceback level to crash, goroutines from all threads aren't printed.
See: https://github.com/golang/go/issues/13161.

This is important because SIGQUIT traces will miss on goroutines.

https://mattermost.atlassian.net/browse/MM-27887
Этот коммит содержится в:
Agniva De Sarker
2020-08-17 22:08:25 +05:30
коммит произвёл GitHub
родитель f16fb6f855
Коммит d48eec6727

Просмотреть файл

@@ -7,6 +7,7 @@ import (
"net"
"os"
"os/signal"
"runtime/debug"
"syscall"
"github.com/mattermost/mattermost-server/v5/api4"
@@ -54,6 +55,11 @@ func serverCmdF(command *cobra.Command, args []string) error {
}
func runServer(configStore config.Store, disableConfigWatch bool, usedPlatform bool, interruptChan chan os.Signal) error {
// Setting the highest traceback level from the code.
// This is done to print goroutines from all threads (see golang.org/issue/13161)
// and also preserve a crash dump for later investigation.
debug.SetTraceback("crash")
options := []app.Option{
app.ConfigStore(configStore),
app.RunJobs,