Skip to content

Commit

Permalink
Merge pull request #1938 from aaronlehmann/allocator-stuck-tasks
Browse files Browse the repository at this point in the history
allocator: Fix stuck tasks at startup
  • Loading branch information
cyli authored Feb 8, 2017
2 parents 991bf36 + 1c6c9f1 commit ce8e78a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions manager/allocator/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,9 @@ func (a *Allocator) doNetworkInit(ctx context.Context) (err error) {
if a.taskAllocateVote(networkVoter, t.ID) {
// If the task is not attached to any network, network
// allocators job is done. Immediately cast a vote so
// that the task can be moved to ALLOCATED state as
// that the task can be moved to the PENDING state as
// soon as possible.
updateTaskStatus(t, api.TaskStatePending, allocatedStatusMessage)
allocatedTasks = append(allocatedTasks, t)
}
continue
Expand Down Expand Up @@ -467,7 +468,7 @@ func taskDead(t *api.Task) bool {
}

// taskReadyForNetworkVote checks if the task is ready for a network
// vote to move it to ALLOCATED state.
// vote to move it to PENDING state.
func taskReadyForNetworkVote(t *api.Task, s *api.Service, nc *networkContext) bool {
// Task is ready for vote if the following is true:
//
Expand Down

0 comments on commit ce8e78a

Please sign in to comment.