A child task had a local filesystem error. Kill the task.
179400
public synchronized void fsError(TaskAttemptID taskId, String message)
  throws IOException {
    LOG.fatal("Task: " + taskId + " - Killed due to FSError: " + message);
    TaskInProgress tip = runningTasks.get(taskId);
    if (tip != null) {
      tip.reportDiagnosticInfo("FSError: " + message);
      purgeTask(tip, true);
    }
    if (isDiskOutOfSpaceError(message)) {
      this.myInstrumentation.diskOutOfSpaceTask(taskId);
    }
  }
754769
def kill(self):
        
        try:
            os.unlink(self.server_address)
        except OSError:
            if os.path.exists(self.server_address):
                raise
1076208
def terminate(self):
        
        logger.info('Sending SIGTERM to task {0}'.format(self.name))
        if hasattr(self, 'remote_client') and self.remote_client is not None:
            self.terminate_sent = True
            self.remote_client.close()
            return
        if not self.process:
            raise DagobahError('task does not have a running process')
        self.terminate_sent = True
        self.process.terminate()
241821
def kill_child_processes() -> None:
    
    timeout_sec = 5
    for p in processes:
        try:
            p.wait(timeout_sec)
        except TimeoutExpired:
            # failed to close
            p.kill()
1090803
def cleanup(self):
        """"""
        shutil.rmtree(self.name, onerror=lambda *a: os.chmod(a[1], __import__('stat').S_IWRITE) or os.unlink(a[1]))
        if os.path.exists(self.name):
            raise IOError(17, "File exists: '{}'".format(self.name))
617969
@Override
  public void onFailedTask() {
    LOG.entering("TaskNodeImpl", "onFailedTask", getQualifiedName());
    if (!running.compareAndSet(true, false)) {
      LOG.fine(getQualifiedName() + "Trying to set failed on an already failed task. Something fishy!!!");
      LOG.exiting("TaskNodeImpl", "onFailedTask", getQualifiedName() +
          "Trying to set failed on an already failed task. Something fishy!!!");
      return;
    }
    taskNodeStatus.clearStateAndReleaseLocks();
    LOG.finest(getQualifiedName() + "Changed status to failed.");
    LOG.finest(getQualifiedName() + "Resetting topoSetupSent to false");
    topoSetupSent.set(false);
    if (parent != null && parent.isRunning()) {
      parent.onChildDead(taskId);
    } else {
      LOG.finest(getQualifiedName() + "Skipping asking parent to process child death");
    }
    for (final TaskNode child : children) {
      if (child.isRunning()) {
        child.onParentDead();
      }
    }
    final int newVersion = this.version.incrementAndGet();
    LOG.finest(getQualifiedName() + "Bumping up to version-" + newVersion);
    LOG.exiting("TaskNodeImpl", "onFailedTask", getQualifiedName());
  }
35138
def end_task(self):
        '''
        
        '''
        self.progress(self.task_stack[-1].size)
        self.task_stack.pop()
319777
def remove_task(cls, task):
        
        with cls._lock:
            if not isinstance(task, Task):
                task = cls.resolved_task(task)

            if task:
                cls.tasks.remove(task)

            cls.tasks.sort()
255688
def task_failure_handler(task_id=None, exception=None,
                         traceback=None, args=None, **kwargs):
    """"""
    # TODO: find a better way to acces workdir/archive/image
    task_report = {'task_id': task_id,
                   'exception': exception,
                   'traceback': traceback,
                   'archive': args[1]['archive_path'],
                   'image': args[1]['image']}
    notifier.send_task_failure_report(task_report)
    workdir = args[1]['workdir']
    remove_file(workdir)
217852
public synchronized void close() throws IOException {
    //
    // Kill running tasks.  Do this in a 2nd vector, called 'tasksToClose',
    // because calling jobHasFinished() may result in an edit to 'tasks'.
    //
    TreeMap<TaskAttemptID, TaskInProgress> tasksToClose =
      new TreeMap<TaskAttemptID, TaskInProgress>();
    tasksToClose.putAll(tasks);
    for (TaskInProgress tip : tasksToClose.values()) {
      tip.jobHasFinished(false);
    }

    this.running = false;

    if (pulseChecker != null) {
      pulseChecker.shutdown();
    }

    if (versionBeanName != null) {
      MBeanUtil.unregisterMBean(versionBeanName);
    }

    // Clear local storage
    if (asyncDiskService != null) {
      // Clear local storage
      asyncDiskService.cleanupAllVolumes();

      // Shutdown all async deletion threads with up to 10 seconds of delay
      asyncDiskService.shutdown();
      try {
        if (!asyncDiskService.awaitTermination(10000)) {
          asyncDiskService.shutdownNow();
          asyncDiskService = null;
        }
      } catch (InterruptedException e) {
        asyncDiskService.shutdownNow();
        asyncDiskService = null;
      }
    }

    // Shutdown the fetcher thread
    if (this.mapEventsFetcher != null) {
      this.mapEventsFetcher.interrupt();
    }

    // Stop the launchers
    this.mapLauncher.interrupt();
    this.reduceLauncher.interrupt();
    if (this.heartbeatMonitor != null) {
      this.heartbeatMonitor.interrupt();
    }

    // Stop memory manager thread
    if (this.taskMemoryManager != null) {
      this.taskMemoryManager.shutdown();
    }

    // Stop cgroup memory watcher
    this.cgroupMemoryWatcher.shutdown();

    // All tasks are killed. So, they are removed from TaskLog monitoring also.
    // Interrupt the monitor.
    getTaskLogsMonitor().interrupt();

    jvmManager.stop();

    // shutdown RPC connections
    RPC.stopProxy(jobClient);

    // wait for the fetcher thread to exit
    for (boolean done = false; !done; ) {
      try {
        if (this.mapEventsFetcher != null) {
          this.mapEventsFetcher.join();
        }
        done = true;
      } catch (InterruptedException e) {
      }
    }

    if (taskReportServer != null) {
      taskReportServer.stop();
      taskReportServer = null;
    }
    if (healthChecker != null) {
      //stop node health checker service
      healthChecker.stop();
      healthChecker = null;
    }

    if (this.server != null) {
      try {
        LOG.info("Shutting down StatusHttpServer");
        this.server.stop();
        LOG.info("Shutting down Netty MapOutput Server");
        if (this.nettyMapOutputServer != null) {
          this.nettyMapOutputServer.stop();
        }
      } catch (Exception e) {
        LOG.warn("Exception shutting down TaskTracker", e);
      }
    }
  }
648140
def child_task(self):
        ''''''
        mp_util.child_close_fds()
        from wx_loader import wx
        state = self

        self.app = wx.App(False)
        self.app.frame = MPImageFrame(state=self)
        self.app.frame.Show()
        self.app.MainLoop()
1006383
function (path, callback) {
    var mkdir = child_process.spawn('mkdir', ['-p', path]);
    mkdir.on('error', function (err) {
        callback(err);
        callback = function(){};
    });
    mkdir.on('exit', function (code) {
        if (code === 0) callback();
        else callback(new Error('mkdir exited with code: ' + code));
    });
}
870529
private static void deleteLocalPath(MRAsyncDiskService asyncDiskService,
      LocalFileSystem fs, Path path) throws IOException {
    boolean deleted = false;
    if (asyncDiskService != null) {
      // Try to delete using asyncDiskService
      String localPathToDelete =
        path.toUri().getPath();
      deleted = asyncDiskService.moveAndDeleteAbsolutePath(localPathToDelete);
      if (!deleted) {
        LOG.warn("Cannot find DistributedCache path " + localPathToDelete
            + " on any of the asyncDiskService volumes!");
      }
    }
    if (!deleted) {
      // If no asyncDiskService, we will delete the files synchronously
      fs.delete(path, true);
    }
    LOG.info("Deleted path " + path);
  }
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);
      }
    }
  }
137864
def kill(self):
        """"""
        if not self.is_dead():
            self.bundle_engine.warnline("{0} did not shut down cleanly, killing.".format(self.service.name))
            try:
                if hasattr(self.process, 'pid'):
                    for child in psutil.Process(self.process.pid).children(recursive=True):
                        os.kill(child.pid, signal.SIGKILL)
                    self.process.kill()
            except psutil.NoSuchProcess:
                pass
1063280
def _subtask_error(self, idx, error):
        """"""
        self.set_exception(error)
        self.errbacks.clear()
304192
def kill_child_processes(parent_proc):
    
    logging.debug("Killing stress process")
    try:
        for proc in parent_proc.children(recursive=True):
            logging.debug('Killing %s', proc)
            proc.kill()
        parent_proc.kill()
    except AttributeError:
        logging.debug('No such process')
        logging.debug('Could not kill process')