@@ -30,6 +30,7 @@ import (
3030 "github.com/tikv/pd/pkg/errs"
3131 "github.com/tikv/pd/pkg/etcdutil"
3232 "github.com/tikv/pd/pkg/grpcutil"
33+ "github.com/tikv/pd/pkg/logutil"
3334 "github.com/tikv/pd/pkg/slice"
3435 "github.com/tikv/pd/pkg/syncutil"
3536 "github.com/tikv/pd/server/config"
@@ -341,6 +342,7 @@ func (am *AllocatorManager) getLocalTSOAllocatorPath() string {
341342
342343// similar logic with leaderLoop in server/server.go
343344func (am * AllocatorManager ) allocatorLeaderLoop (ctx context.Context , allocator * LocalTSOAllocator ) {
345+ defer logutil .LogPanic ()
344346 defer log .Info ("server is closed, return local tso allocator leader loop" ,
345347 zap .String ("dc-location" , allocator .GetDCLocation ()),
346348 zap .String ("local-tso-allocator-name" , am .member .Member ().Name ))
@@ -592,6 +594,7 @@ func (am *AllocatorManager) allocatorUpdater() {
592594
593595// updateAllocator is used to update the allocator in the group.
594596func (am * AllocatorManager ) updateAllocator (ag * allocatorGroup ) {
597+ defer logutil .LogPanic ()
595598 defer am .wg .Done ()
596599 select {
597600 case <- ag .ctx .Done ():
@@ -642,6 +645,7 @@ func (am *AllocatorManager) allocatorPatroller(serverCtx context.Context) {
642645// ClusterDCLocationChecker collects all dc-locations of a cluster, computes some related info
643646// and stores them into the DCLocationInfo, then finally writes them into am.mu.clusterDCLocations.
644647func (am * AllocatorManager ) ClusterDCLocationChecker () {
648+ defer logutil .LogPanic ()
645649 // Wait for the PD leader to be elected out.
646650 if am .member .GetLeader () == nil {
647651 return
0 commit comments