Kills the given jobs, represented as Job ids, then checks they are dead by checking
        they are not in the list of issued jobs.
166729
def killBatchJobs(self, jobIDs):
        
        while True:
            for jobID in jobIDs:
                if jobID in self.runningJobs:
                    self.runningJobs.remove(jobID)
                exitValue = self._runParasol(['remove', 'job', str(jobID)],
                                             autoRetry=False)[0]
                logger.debug("Tried to remove jobID: %i, with exit value: %i" % (jobID, exitValue))
            runningJobs = self.getIssuedBatchJobIDs()
            if set(jobIDs).difference(set(runningJobs)) == set(jobIDs):
                break
            logger.warn( 'Tried to kill some jobs, but something happened and they are still '
                         'going, will try againin 5s.')
            time.sleep(5)
        # Update the CPU usage, because killed jobs aren't written to the results file.
        for jobID in jobIDs:
            if jobID in list(self.jobIDsToCpu.keys()):
                self.usedCpus -= self.jobIDsToCpu.pop(jobID)
778256
def kill(self, nb = 1):
        
        self.count_lock.acquire()
        if nb > self.workers:
            nb = self.workers
        self.count_lock.release()
        for x in xrange(nb):
            self.tasks.put(WorkerExit())
209465
def kill_all(job_queue, reason='None given', states=None):
    """"""
    if states is None:
        states = ['STARTING', 'RUNNABLE', 'RUNNING']
    batch = boto3.client('batch')
    runnable = batch.list_jobs(jobQueue=job_queue, jobStatus='RUNNABLE')
    job_info = runnable.get('jobSummaryList')
    if job_info:
        job_ids = [job['jobId'] for job in job_info]
        # Cancel jobs
        for job_id in job_ids:
            batch.cancel_job(jobId=job_id, reason=reason)
    res_list = []
    for status in states:
        running = batch.list_jobs(jobQueue=job_queue, jobStatus=status)
        job_info = running.get('jobSummaryList')
        if job_info:
            job_ids = [job['jobId'] for job in job_info]
            for job_id in job_ids:
                logger.info('Killing %s' % job_id)
                res = batch.terminate_job(jobId=job_id, reason=reason)
                res_list.append(res)
    return res_list
21321
def delete(self, job: JobOrID) -> None:
        
        self._send_cmd(b'delete %d' % _to_id(job), b'DELETED')
580261
public void removeJob(JobID jobId) throws Exception {
		LOG.debug("Remove job {} from job leader id monitoring.", jobId);

		JobLeaderIdListener listener = jobLeaderIdListeners.remove(jobId);

		if (listener != null) {
			listener.stop();
		}
	}
345267
def kill_all(signal)
      idle, running = partition_workers
      log "kill -#{signal} #{running.map { |r| r.pid }.inspect}"
      running.each { |worker| worker.kill(signal) }
    end
434865
@Deprecated
  public void executeJobs(List<String> jobIds) {
    if(!processEngines.isEmpty()) {
      executeJobs(jobIds, processEngines.get(0));
    }
  }
594206
def cancel(id)
      Log.warn "Cancelling job id #{id}"
      job = @jobs_by_id[id]
      job.status = Executor::STATUS_ERROR
      job.owner = nil
      job.time_end = Time.now
      @queue.delete(job)
    end
202607
def stop_job(self, job_id, array_id = None):
    """"""
    self.lock()

    job, array_job = self._job_and_array(job_id, array_id)
    if job is not None:
      if job.status in ('executing', 'queued', 'waiting'):
        logger.info("Reset job '%s' (%s) in the database", job.name, self._format_log(job.id))
        job.status = 'submitted'

      if array_job is not None and array_job.status in ('executing', 'queued', 'waiting'):
        logger.debug("Reset array job '%s' in the database", array_job)
        array_job.status = 'submitted'
      if array_job is None:
        for array_job in job.array:
          if array_job.status in ('executing', 'queued', 'waiting'):
            logger.debug("Reset array job '%s' in the database", array_job)
            array_job.status = 'submitted'

    self.session.commit()
    self.unlock()
940487
def delete(args):
  """"""
  jm = setup(args)
  # first, stop the jobs if they are running in the grid
  if not args.local and 'executing' in args.status:
    stop(args)
  # then, delete them from the database
  jm.delete(job_ids=get_ids(args.job_ids), array_ids=get_ids(args.array_ids), delete_logs=not args.keep_logs, delete_log_dir=not args.keep_log_dir, status=args.status)
1254207
function abort(state)
{
  Object.keys(state.jobs).forEach(clean.bind(state));

  // reset leftover jobs
  state.jobs = {};
}
626115
def kick_job(self, job: JobOrID) -> None:
        
        self._send_cmd(b'kick-job %d' % _to_id(job), b'KICKED')
857565
def cmd_kill():
    """"""
    db = connect()
    count = terminate(db, args.databases)
    if count == 0:
        log.error("No connections could be killed")
        # Return status 1, like killall
        sys.exit(1)
462354
public function kill()
    {

        if (!$this->checkPid()) {
            // already dead
            $this->markAsDisappeared(sprintf('Did not kill job "%s" (id: %s), because it was already dead.', $this->getJobCode(), $this->getId()));
            return;
        }

        // let's be nice first (a.k.a. "Could you please stop running now?")
        if (posix_kill($this->getPid(), SIGINT)) {
            $this->log(sprintf('Sending SIGINT to job "%s" (id: %s)', $this->getJobCode(), $this->getId()));
        } else {
            $this->log(sprintf('Error while sending SIGINT to job "%s" (id: %s)', $this->getJobCode(), $this->getId()), Zend_Log::ERR);
        }

        // check if process terminates within 30 seconds
        $startTime = time();
        while (($waitTime = (time() - $startTime) < 30) && $this->checkPid()) {
            sleep(2);
        }

        if ($this->checkPid()) {
            // What, you're still alive? OK, time to say goodbye now. You had your chance...
            if (posix_kill($this->getPid(), SIGKILL)) {
                $this->log(sprintf('Sending SIGKILL to job "%s" (id: %s)', $this->getJobCode(), $this->getId()));
            } else {
                $this->log(sprintf('Error while sending SIGKILL to job "%s" (id: %s)', $this->getJobCode(), $this->getId()), Zend_Log::ERR);
            }
        } else {
            $this->log(sprintf('Killed job "%s" (id: %s) with SIGINT. Job terminated after %s second(s)', $this->getJobCode(), $this->getId(), $waitTime));
        }

        if ($this->checkPid()) {
            sleep(5);
            if ($this->checkPid()) {
                $this->log(sprintf('Killed job "%s" (id: %s) is still alive!', $this->getJobCode(), $this->getId()), Zend_Log::ERR);
                return; // without setting the status to "killed"
            }
        }

        $this
            ->setStatus(self::STATUS_KILLED)
            ->setFinishedAt(strftime('%Y-%m-%d %H:%M:%S', time()))
            ->save();
    }
461989
def cancel(self, job_ids):
        ''' 
        '''

        job_id_list = ' '.join(job_ids)
        retcode, stdout, stderr = self.channel.execute_wait("qdel {0}".format(job_id_list), 3)
        rets = None
        if retcode == 0:
            for jid in job_ids:
                self.resources[jid]['status'] = translate_table['E']  # Setting state to exiting
            rets = [True for i in job_ids]
        else:
            rets = [False for i in job_ids]

        return rets
687183
async def kill_job(self, message: BackendKillJob):
        
        try:
            if message.job_id in self._container_for_job:
                self._containers_killed[self._container_for_job[message.job_id]] = "killed"
                await self._docker.kill_container(self._container_for_job[message.job_id])
            else:
                self._logger.warning("Cannot kill container for job %s because it is not running", str(message.job_id))
        except asyncio.CancelledError:
            raise
        except:
            self._logger.exception("Exception in handle_kill_job")
255117
def killServices(self, services, error=False):
        
        for serviceJobStoreID in services:
            serviceJob = services[serviceJobStoreID]
            if error:
                self.jobStore.deleteFile(serviceJob.errorJobStoreID)
            self.jobStore.deleteFile(serviceJob.terminateJobStoreID)