From ccda86a679e31c992e15fe60d08ca64f2578cace Mon Sep 17 00:00:00 2001 From: xuhuaiyu <391585975@qq.com> Date: Mon, 13 Jul 2020 11:45:46 +0800 Subject: [PATCH] server: return the actual error when conn panic --- server/conn.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/conn.go b/server/conn.go index 9bf513cdbf495..11576da333425 100644 --- a/server/conn.go +++ b/server/conn.go @@ -669,6 +669,8 @@ func (cc *clientConn) Run(ctx context.Context) { zap.String("err", fmt.Sprintf("%v", r)), zap.String("stack", string(buf)), ) + err := cc.writeError(errors.New(fmt.Sprintf("%v", r))) + terror.Log(err) metrics.PanicCounter.WithLabelValues(metrics.LabelSession).Inc() } if atomic.LoadInt32(&cc.status) != connStatusShutdown {