Skip to content

Commit

Permalink
Add description for allocs stopped due to reconnect (#12270)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekStrickland committed Mar 14, 2022
1 parent 13e14ac commit f03749d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions scheduler/generic_sched.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ const (
// allocNotNeeded is the status used when a job no longer requires an allocation
allocNotNeeded = "alloc not needed due to job update"

// allocReconnected is the status to use when a replacement allocation is stopped
// because a disconnected node reconnects.
allocReconnected = "alloc not needed due to disconnected client reconnect"

// allocMigrating is the status used when we must migrate an allocation
allocMigrating = "alloc is being migrated"

Expand Down
5 changes: 4 additions & 1 deletion scheduler/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -1053,15 +1053,18 @@ func (a *allocReconciler) computeStopByReconnecting(untainted, reconnecting, sto
continue
}

statusDescription := allocNotNeeded
if untaintedMaxScoreMeta.NormScore > reconnectingMaxScoreMeta.NormScore {
stopAlloc = reconnectingAlloc
deleteSet = reconnecting
} else {
statusDescription = allocReconnected
}

stop[stopAlloc.ID] = stopAlloc
a.result.stop = append(a.result.stop, allocStopResult{
alloc: stopAlloc,
statusDescription: allocNotNeeded,
statusDescription: statusDescription,
})
delete(deleteSet, stopAlloc.ID)

Expand Down

0 comments on commit f03749d

Please sign in to comment.