Skip to content

Commit

Permalink
executor: fix the issue of coordinator.Close() taking too long (#50494)
Browse files Browse the repository at this point in the history
close #50493
  • Loading branch information
guo-shaoge authored Jan 19, 2024
1 parent 7ba2330 commit 1442f07
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/executor/internal/mpp/executor_with_retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,10 @@ func (r *ExecutorWithRetry) Next(ctx context.Context) (resp kv.ResultSubset, err
func (r *ExecutorWithRetry) Close() error {
r.mppErrRecovery.ResetHolder()
r.memTracker.Detach()
// Need to close coordinator before unregister to avoid coord.Close() takes too long.
err := r.coord.Close()
mppcoordmanager.InstanceMPPCoordinatorManager.Unregister(r.getCoordUniqueID())
return r.coord.Close()
return err
}

func (r *ExecutorWithRetry) setupMPPCoordinator(ctx context.Context, recoverying bool) ([]kv.KeyRange, error) {
Expand Down

0 comments on commit 1442f07

Please sign in to comment.