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 {