Skip to content

Commit 94f95c4

Browse files
committed
update
1 parent 87d86ae commit 94f95c4

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

pkg/disttask/framework/scheduler/balancer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func (b *balancer) balanceLoop(ctx context.Context, sm *Manager) {
7474
func (b *balancer) balance(ctx context.Context, sm *Manager) {
7575
// we will use currUsedSlots to calculate adjusted eligible nodes during balance,
7676
// it's initial value depends on the managed nodes, to have a consistent view,
77-
// DO NOT call getManagedNodes twice during 1 balance.
77+
// DO NOT call getNodes twice during 1 balance.
7878
managedNodes := b.nodeMgr.getNodes()
7979
b.currUsedSlots = make(map[string]int, len(managedNodes))
8080
for _, n := range managedNodes {

pkg/disttask/framework/taskexecutor/task_executor.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -447,10 +447,12 @@ func (e *BaseTaskExecutor) runSubtask(subtask *proto.Subtask) (resErr error) {
447447
defer func() {
448448
checkCancel()
449449
wg.Wait()
450-
subtaskCtxCancel()
451450
}()
452451
return e.stepExec.RunSubtask(subtaskCtx, subtask)
453452
}()
453+
defer func() {
454+
subtaskCtxCancel()
455+
}()
454456
failpoint.InjectCall("afterRunSubtask", e, &subtaskErr)
455457
logTask.End2(zap.InfoLevel, subtaskErr)
456458

@@ -463,7 +465,7 @@ func (e *BaseTaskExecutor) runSubtask(subtask *proto.Subtask) (resErr error) {
463465
return subtaskErr
464466
}
465467

466-
err := e.finishSubtask(e.stepCtx, subtask)
468+
err := e.finishSubtask(subtaskCtx, subtask)
467469
failpoint.InjectCall("syncAfterSubtaskFinish")
468470
return err
469471
}
@@ -570,7 +572,7 @@ func (e *BaseTaskExecutor) markSubTaskCanceledOrFailed(ctx context.Context, subt
570572
return e.updateSubtaskStateAndErrorImpl(e.ctx, subtask.ExecID, subtask.ID, proto.SubtaskStateCanceled, nil)
571573
}
572574

573-
e.logger.Info("meet context canceled for gracefully shutdown")
575+
e.logger.Info("meet context canceled for gracefully shutdown", zap.Error(ctx.Err()))
574576
} else if e.IsRetryableError(stErr) {
575577
e.logger.Warn("meet retryable error", zap.Error(stErr))
576578
} else {

0 commit comments

Comments
 (0)