From 98e59305346944adb0d9416481cf2b8004a339c1 Mon Sep 17 00:00:00 2001 From: gazebo Date: Wed, 18 Jul 2018 23:22:03 +0800 Subject: [PATCH] - print stack info when goroutine panic. --- utils/routinepool/routinepool.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/routinepool/routinepool.go b/utils/routinepool/routinepool.go index 8135fa1f..a15eb76e 100644 --- a/utils/routinepool/routinepool.go +++ b/utils/routinepool/routinepool.go @@ -4,6 +4,7 @@ import ( "crypto/md5" "encoding/binary" "fmt" + "runtime/debug" ) const ( @@ -46,6 +47,7 @@ func callHandler(handler func()) (retVal interface{}) { defer func() { if r := recover(); r != nil { retVal = r + debug.PrintStack() } }() handler()