@@ -31,6 +31,7 @@ import (
3131 "github.com/tikv/pd/pkg/errs"
3232 "github.com/tikv/pd/pkg/etcdutil"
3333 "github.com/tikv/pd/pkg/grpcutil"
34+ "github.com/tikv/pd/pkg/logutil"
3435 "github.com/tikv/pd/pkg/slice"
3536 "github.com/tikv/pd/pkg/syncutil"
3637 "github.com/tikv/pd/server/config"
@@ -361,6 +362,7 @@ func (am *AllocatorManager) getLocalTSOAllocatorPath() string {
361362
362363// similar logic with leaderLoop in server/server.go
363364func (am * AllocatorManager ) allocatorLeaderLoop (ctx context.Context , allocator * LocalTSOAllocator ) {
365+ defer logutil .LogPanic ()
364366 defer log .Info ("server is closed, return local tso allocator leader loop" ,
365367 zap .String ("dc-location" , allocator .GetDCLocation ()),
366368 zap .String ("local-tso-allocator-name" , am .member .Member ().Name ))
@@ -612,6 +614,7 @@ func (am *AllocatorManager) allocatorUpdater() {
612614
613615// updateAllocator is used to update the allocator in the group.
614616func (am * AllocatorManager ) updateAllocator (ag * allocatorGroup ) {
617+ defer logutil .LogPanic ()
615618 defer am .wg .Done ()
616619 select {
617620 case <- ag .ctx .Done ():
@@ -662,6 +665,7 @@ func (am *AllocatorManager) allocatorPatroller(serverCtx context.Context) {
662665// ClusterDCLocationChecker collects all dc-locations of a cluster, computes some related info
663666// and stores them into the DCLocationInfo, then finally writes them into am.mu.clusterDCLocations.
664667func (am * AllocatorManager ) ClusterDCLocationChecker () {
668+ defer logutil .LogPanic ()
665669 // Wait for the PD leader to be elected out.
666670 if am .member .GetLeader () == nil {
667671 return
0 commit comments