Merge pull request #967 from crazycs520/refine-log2

*: refine panic log
This commit is contained in:
you06 2023-09-11 14:59:15 +08:00 committed by GitHub
commit f9e28714c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -301,7 +301,7 @@ func (a *batchConn) batchSendLoop(cfg config.TiKVClient) {
if r := recover(); r != nil {
metrics.TiKVPanicCounter.WithLabelValues(metrics.LabelBatchSendLoop).Inc()
logutil.BgLogger().Error("batchSendLoop",
zap.Reflect("r", r),
zap.Any("r", r),
zap.Stack("stack"))
logutil.BgLogger().Info("restart batchSendLoop")
go a.batchSendLoop(cfg)
@ -436,7 +436,7 @@ func (s *batchCommandsStream) recv() (resp *tikvpb.BatchCommandsResponse, err er
if r := recover(); r != nil {
metrics.TiKVPanicCounter.WithLabelValues(metrics.LabelBatchRecvLoop).Inc()
logutil.BgLogger().Error("batchCommandsClient.recv panic",
zap.Reflect("r", r),
zap.Any("r", r),
zap.Stack("stack"))
err = errors.New("batch conn recv paniced")
}
@ -604,7 +604,7 @@ func (c *batchCommandsClient) batchRecvLoop(cfg config.TiKVClient, tikvTransport
if r := recover(); r != nil {
metrics.TiKVPanicCounter.WithLabelValues(metrics.LabelBatchRecvLoop).Inc()
logutil.BgLogger().Error("batchRecvLoop",
zap.Reflect("r", r),
zap.Any("r", r),
zap.Stack("stack"))
logutil.BgLogger().Info("restart batchRecvLoop")
go c.batchRecvLoop(cfg, tikvTransportLayerLoad, streamClient)

View File

@ -587,7 +587,7 @@ func (c *RegionCache) checkAndResolve(needCheckStores []*Store, needCheck func(*
r := recover()
if r != nil {
logutil.BgLogger().Error("panic in the checkAndResolve goroutine",
zap.Reflect("r", r),
zap.Any("r", r),
zap.Stack("stack trace"))
}
}()
@ -2993,7 +2993,7 @@ func (c *RegionCache) checkAndUpdateStoreSlowScores() {
r := recover()
if r != nil {
logutil.BgLogger().Error("panic in the checkAndUpdateStoreSlowScores goroutine",
zap.Reflect("r", r),
zap.Any("r", r),
zap.Stack("stack trace"))
}
}()

View File

@ -89,7 +89,7 @@ func WithRecovery(exec func(), recoverFn func(r interface{})) {
}
if r != nil {
logutil.BgLogger().Error("panic in the recoverable goroutine",
zap.Reflect("r", r),
zap.Any("r", r),
zap.Stack("stack trace"))
}
}()