diff --git a/server/conn.go b/server/conn.go index 4c08250d52517..f1c1c19a85d3a 100644 --- a/server/conn.go +++ b/server/conn.go @@ -662,6 +662,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 {