Marks a task as deleted, optionally specifying a completion
        date with the 'end' argument.
493124
def task_delete(self, **kw):
        
        def validate(task):
            if task['status'] == Status.DELETED:
                raise ValueError("Task is already deleted.")

        return self._task_change_status(Status.DELETED, validate, **kw)
754427
def on_failure(self, exc, task_id, args, kwargs, einfo):
        
        if not FailedTask.objects.filter(task_id=task_id, datetime_resolved=None).exists():
            FailedTask.objects.create(
                task_name=_truncate_to_field(FailedTask, 'task_name', self.name),
                task_id=task_id,  # Fixed length UUID: No need to truncate
                args=args,
                kwargs=kwargs,
                exc=_truncate_to_field(FailedTask, 'exc', repr(exc)),
            )
        super(PersistOnFailureTask, self).on_failure(exc, task_id, args, kwargs, einfo)
1048840
def mark_done(self, node_id):
        
        with self.lock:
            self.in_progress.remove(node_id)
            self.graph.remove_node(node_id)
            self._find_new_additions()
            self.inner.task_done()
708808
void removeMarkedTasks(String taskTracker) {
    // Purge all the 'marked' tasks which were running at taskTracker
    Set<TaskAttemptID> markedTaskSet =
      trackerToMarkedTasksMap.get(taskTracker);
    if (markedTaskSet != null) {
      for (TaskAttemptID taskid : markedTaskSet) {
        removeTaskEntry(taskid);
        if (LOG.isDebugEnabled()) {
          LOG.debug("Removed marked completed task '" + taskid + "' from '" +
                    taskTracker + "'");
        }
      }
      // Clear
      trackerToMarkedTasksMap.remove(taskTracker);
    }
  }
166147
def terminate(self):
        
        log = self._params.get('log', self._discard)
        self._dnr = time.time()
        self.stop()
        log.info("Task '%s' marked for death", self._name)
1148554
def cancel(**kwargs):
    
    task_list = _query(**kwargs)
    for task in task_list:
        task.status = WorkQueue.CANCELED
        task.finished = datetime.datetime.utcnow()
        db.session.add(task)
    return len(task_list)
405669
final void postComplete() {
        /*
         * On each step, variable f holds current dependents to pop
         * and run.  It is extended along only one path at a time,
         * pushing others to avoid unbounded recursion.
         */
        CompletableFuture<?> f = this; Completion h;
        while ((h = f.stack) != null ||
               (f != this && (h = (f = this).stack) != null)) {
            CompletableFuture<?> d; Completion t;
            if (f.casStack(h, t = h.next)) {
                if (t != null) {
                    if (f != this) {
                        pushStack(h);
                        continue;
                    }
                    h.next = null;    // detach
                }
                f = (d = h.tryFire(NESTED)) == null ? this : d;
            }
        }
    }
1244420
function taskComplete() {
  winston.info(_pkgname + "task done #"+this.id + ' [' + this.data.id + ']');
  // now instantiate the next set of tasks
  //issueJobsNextLevel(this.data.jobname, this, this.data.flow);
  if(this.data._done) {
    this.data._done(this);
  }
}
1030304
def finish(self, *args, **kwargs):
        
        log.debug('finish(args={args}, kwargs={kwargs})'.format(args=args, kwargs=kwargs))
        self.on_finish(*args, **kwargs)
1206789
protected void awaitTasksTermination()
   {
      delegated.shutdown();
      try
      {
         delegated.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
      }
      catch (InterruptedException e)
      {
         LOG.warn("Termination has been interrupted");
      }
   }
1253563
function completeTask(task, callback) {
    database.serialize(function() {
      var delete_task = "DELETE FROM "+table_name+" WHERE "+table_name+".id = ?";

      log.debug('sqlite-adapter','Running query:',delete_task);
      database.run(delete_task, task.id, function(error) {
        if (error) {
          callback(error);
        }
        callback(error, this.changes);
      });
    });
  }
180630
def stop(task = :default)
      return nil unless tasks.keys.include?(task) && active?(task)
      time_taken = Time.now.to_f - tasks[task][:current].to_f
      tasks[task][:history] << { start: tasks[task][:current], stop: Time.now.to_f, time: time_taken }
      tasks[task][:current] = nil
      if retention && tasks[task][:history].size > retention then tasks[task][:history].shift end
      time_taken
    end
178649
def task_del(self, t):
        
        name = t._name
        if name in self._tasknames:
            del self._tasknames[name]
        self._tasks.discard(t)
        self._tasks_scoped.discard(t)
        try:
            t.stop()
        except:
            log = self._params.get('log', self._discard)
            log.error("Failed to stop processes for task %r -- %s", name, e, exc_info=log.isEnabledFor(logging.DEBUG))
        for pid in t.get_pids():
            self.proc_del(pid)
403277
public function endTask()
    {
        $name = array_pop($this->taskStack);

        $contents = trim(ob_get_clean());

        if (isset($this->tasks[$name])) {
            $this->tasks[$name] = str_replace('@parent', $this->tasks[$name], $contents);
        } else {
            $this->tasks[$name] = $contents;
        }
    }
1351995
public void markAsToBeDeleted()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "markAsToBeDeleted");

        toBeDeleted = true;

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "markAsToBeDeleted");
    }
246435
synchronized void cleanUpOverMemoryTask(TaskAttemptID tid, boolean wasFailure,
      String diagnosticMsg) {
    TaskInProgress tip = runningTasks.get(tid);
    if (tip != null) {
      tip.reportDiagnosticInfo(diagnosticMsg);
      try {
        purgeTask(tip, wasFailure); // Marking it as failed/killed.
      } catch (IOException ioe) {
        LOG.warn("Couldn't purge the task of " + tid + ". Error : " + ioe);
      }
    }
  }
512791
def is_previous_task_processing(self, *args, **kwargs):
        
        app = self._get_app()
        inspect = app.control.inspect()
        active = inspect.active() or {}
        scheduled = inspect.scheduled() or {}
        reserved = inspect.reserved() or {}
        uncompleted = sum(list(active.values()) + list(scheduled.values()) + reserved.values(), [])
        return any(self.is_equal(task, *args, **kwargs) for task in uncompleted)