Skip to content

Commit adbbfec

Browse files
author
Michal Tichák
committed
fixup! fixup! [core] deployment retry properly retries only failed tasks
1 parent ff6c7ac commit adbbfec

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

core/task/manager.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -554,25 +554,25 @@ func (m *Manager) acquireTasks(envId uid.ID, taskDescriptors Descriptors) (err e
554554
log.WithField("tasksToRunThisAttempt", len(tasksToRunThisAttempt)).
555555
WithField("partition", envId))
556556

557-
deployedThisRound := roOutcome.deployed
557+
deployedThisAttempt := roOutcome.deployed
558558
undeployedDescriptors = roOutcome.undeployed
559559
undeployableDescriptors = roOutcome.undeployable
560560

561-
logWithId.WithField("tasks", deployedThisRound).
562-
Debugf("resourceOffers is done, %d new tasks running", len(deployedThisRound))
561+
logWithId.WithField("tasks", deployedThisAttempt).
562+
Debugf("resourceOffers is done, %d new tasks running", len(deployedThisAttempt))
563563

564-
for deployedTask, deployedDescriptor := range deployedThisRound {
564+
for deployedTask, deployedDescriptor := range deployedThisAttempt {
565565
allDeployedTasks[deployedTask] = deployedDescriptor
566566
// add deployed tasks to roster, so updates can be distributed properly
567567
m.roster.append(deployedTask)
568568
}
569569

570-
if len(deployedThisRound) != len(tasksToRunThisAttempt) {
570+
if len(deployedThisAttempt) != len(tasksToRunThisAttempt) {
571571
// ↑ Not all roles could be deployed. If some were critical,
572572
// we cannot proceed with running this environment. Either way,
573573
// we keep the roles running since they might be useful in the future.
574574
logWithId.WithField("level", infologger.IL_Devel).
575-
Errorf("environment deployment failure: %d tasks requested for deployment, but %d deployed", len(tasksToRunThisAttempt), len(deployedThisRound))
575+
Errorf("environment deployment failure: %d tasks requested for deployment, but %d deployed", len(tasksToRunThisAttempt), len(deployedThisAttempt))
576576

577577
for _, desc := range undeployedDescriptors {
578578
if desc.TaskRole.GetTaskTraits().Critical == true {
@@ -596,7 +596,7 @@ func (m *Manager) acquireTasks(envId uid.ID, taskDescriptors Descriptors) (err e
596596
if deploymentSuccess {
597597
// ↑ means all the required critical processes are now running,
598598
// and we are ready to update the envId
599-
for taskPtr, descriptor := range deployedThisRound {
599+
for taskPtr, descriptor := range deployedThisAttempt {
600600
taskPtr.SetParent(descriptor.TaskRole)
601601
// Ensure everything is filled out properly
602602
if !taskPtr.IsLocked() {

0 commit comments

Comments
 (0)