code: func (g *Orchestrator) FixTask(ctx context.Context, batch *store.Batch, t *api.Task) {
  	if _, exists := g.globalServices[t.ServiceID]; !exists {
  		return
  	}
  	// if a task's DesiredState has past running, the task has been processed
  	if t.DesiredState > api.TaskStateRunning {
  		return
  	}
  
  	var node *api.Node
  	if t.NodeID != "" {
  		node = g.nodes[t.NodeID]
  	}
  	// if the node no longer valid, remove the task
  	if t.NodeID == "" || orchestrator.InvalidNode(node) {
  		g.shutdownTask(ctx, batch, t)
  		return
  	}
  
  	// restart a task if it fails
  	if t.Status.State > api.TaskStateRunning {
  		g.restartTasks[t.ID] = struct{}{}
  	}
  }
docs: // FixTask validates a task with the current cluster settings, and takes
  // action to make it conformant to node state and service constraint
  // it's called at orchestrator initialization