Public: The old worker process finished!
488836
def finished!(process_status)
      if process_status.nil? && ! @self_started
        log :debug, "(#{@pid}/#{@pids.inspect}/self_started=#{@self_started}/killed=#{@killed}) I am no longer blocked."
        @pid = nil
        @backoff.died unless @killed
      elsif ! process_status.nil? && @self_started
        log :debug, "(#{@pid}/#{@pids.inspect}/self_started=#{@self_started}/killed=#{@killed}) I exited: #{process_status}"
        @pid = nil
        @backoff.died unless @killed
      else
        log :debug, "(#{@pid}/#{@pids.inspect}/self_started=#{@self_started}/killed=#{@killed}) Reports of my death are highly exaggerated (#{process_status.inspect})"
      end
    end
479289
public function doneWorking()
    {
        Event::fire(Event::WORKER_DONE_WORKING, array($this, $this->job));

        $this->redis->hmset(self::redisKey($this), array(
            'job_id'      => '',
            'job_pid'     => 0,
            'job_started' => 0
        ));

        switch ($this->job->getStatus()) {
            case Job::STATUS_COMPLETE:
                $this->redis->hincrby(self::redisKey($this), 'processed', 1);
                break;
            case Job::STATUS_CANCELLED:
                $this->redis->hincrby(self::redisKey($this), 'cancelled', 1);
                break;
            case Job::STATUS_FAILED:
                $this->redis->hincrby(self::redisKey($this), 'failed', 1);
                break;
        }

        $this->job = null;
    }
1328573
private void jobComplete() {
    final JobTrackerInstrumentation metrics = jobtracker.getInstrumentation();
    //
    // All tasks are complete, then the job is done!
    //
    if (this.status.getRunState() == JobStatus.RUNNING ||
        this.status.getRunState() == JobStatus.PREP) {
      changeStateTo(JobStatus.SUCCEEDED);
      this.status.setCleanupProgress(1.0f);
      if (maps.length == 0) {
        this.status.setMapProgress(1.0f);
      }
      if (reduces.length == 0) {
        this.status.setReduceProgress(1.0f);
      }
      this.finishTime = JobTracker.getClock().getTime();
      LOG.info("Job " + this.status.getJobID() +
               " has completed successfully.");

      // Log the job summary (this should be done prior to logging to
      // job-history to ensure job-counters are in-sync
      JobSummary.logJobSummary(this, jobtracker.getClusterStatus(false));

      Counters counters = getCounters();
      // Log job-history
      JobHistory.JobInfo.logFinished(this.status.getJobID(), finishTime,
                                     this.finishedMapTasks,
                                     this.finishedReduceTasks, failedMapTasks,
                                     failedReduceTasks, killedMapTasks,
                                     killedReduceTasks, getMapCounters(),
                                     getReduceCounters(), counters);
      // Note that finalize will close the job history handles which garbage collect
      // might try to finalize
      garbageCollect();

      metrics.completeJob(this.conf, this.status.getJobID());
    }
  }
185251
function resetWorker() {
    sigqueue = [];
    mastersigs.forEach(process.removeAllListeners.bind(process));
    process.removeAllListeners('exit');
    process.env.TIAMAT = '1';
  }
933654
public function work()
    {
        $workerNeed = self::WORKER_MIN * $this->workerMultiplier;
        $workerCount = count($this->workerPool);

        if (
            ($workerCount < $workerNeed && $workerCount < $this->workerMaxCount)
            && !$this->running
        ) {
            // run new worker
            $this->workerRun = $this->workerStarter->start();
            $this->running = time();
        } elseif ($this->running && $this->running < time() - 10) {
            // timeout 10 sec - не удалось запустить воркер
            $this->running = 0;
            if ($this->workerRun->isRunning()) {
                // убиваем запущенный процесс, если он ещё работает
                $this->workerRun->kill();
            }
        }
    }
731538
def finish(self):
        
        # Update the last_offset in the mar header
        self.write_header()
        # Write out the index of contents
        self.write_index()

        if not self.use_old_format:
            # Refresh the signature
            sigs = self.calculate_signatures()
            self.write_signatures(sigs)
549076
def finished(self):
        
        self.progress_bar.set_state(ProgressBar.STATE_DONE)
        self.progress_bar.show()
750942
protected function teardown(): void
    {
        if ($this->worker) {
            @$this->worker->unregisterAll();
            $this->worker = null;
        }
    }
7242
@SuppressWarnings("deprecation")
  private void jobCompleteUnprotected() {
    //
    // All tasks are complete, then the job is done!
    
    if(this.terminated == JobStatus.FAILED 
        || this.terminated == JobStatus.KILLED) {
      terminate(this.terminated);
    }
    if (this.status.getRunState() == JobStatus.RUNNING ||
        this.status.getRunState() == JobStatus.PREP) {
      changeStateTo(JobStatus.SUCCEEDED);
      this.status.setCleanupProgress(1.0f);
      if (maps.length == 0) {
        this.status.setMapProgress(1.0f);
      }
      if (reduces.length == 0) {
        this.status.setReduceProgress(1.0f);
      }
      this.finishTime = clock.getTime();
      LOG.info("Job " + this.status.getJobID() +
               " has completed successfully.");

      // Log the job summary (this should be done prior to logging to
      // job-history to ensure job-counters are in-sync
      JobSummary.logJobSummary(this);

      Counters counters = getCounters();
      // Log job-history
      jobHistory.logFinished(finishTime,
                             this.finishedMapTasks,
                             this.finishedReduceTasks, failedMapTasks,
                             failedReduceTasks, killedMapTasks,
                             killedReduceTasks, getMapCounters(),
                             getReduceCounters(), counters);
    }
  }
1375033
public function complete()
    {
        $this->stopped();

        $this->setStatus(Job::STATUS_COMPLETE);

        $this->redis->zadd(Queue::redisKey($this->queue, 'processed'), time(), $this->payload);
        Stats::incr('processed', 1);
        Stats::incr('processed', 1, Queue::redisKey($this->queue, 'stats'));

        Event::fire(Event::JOB_COMPLETE, $this);
    }
377815
@Deprecated
    protected synchronized void workerDone(Worker w, boolean taskDied) {

        threads_.remove(w);

        if (taskDied) {
            --activeThreads;
            --poolSize_;
        }

        if (poolSize_ == 0 && shutdown_) {
            maximumPoolSize_ = minimumPoolSize_ = 0; // disable new threads
            notifyAll(); // notify awaitTerminationAfterShutdown
        }

        fireThreadDestroyed(poolSize_);
    }
1095755
protected void reportWorked(int workIncrement, int currentUnitIndex) {
        if (this.progress != null) {
            if (this.progress.isCanceled()) {
                // Only AbortCompilation can stop the compiler cleanly.
                // We check cancellation again following the call to compile.
                throw new AbortCompilation(true, null);
            }
            this.progress.worked(workIncrement, (this.totalUnits* this.remainingIterations) - currentUnitIndex - 1);
        }
    }
416699
def reap_workers(waitpidflags = 0)
      loop do
        worker_pid, status = Process.waitpid2(-1, waitpidflags)
        if worker_pid.nil?
          return :none_ready
        else
          log "Worker exited #{status}"
          finish_worker(worker_pid, status)
          report_to_master("-#{worker_pid}")
        end
      end
    rescue Errno::ECHILD
      # All done
      :no_child
    end
1132200
def finished(self):
    

    return self.__state in (Job.ERROR, Job.SUCCESS, Job.CANCELLED)
446111
function worker(message) {
    console.log(`Processing "${message.message.data}"...`);

    setTimeout(() => {
      console.log(`Finished procesing "${message.message.data}".`);
      isProcessed = true;
    }, 30000);
  }
203288
function cleanupWorkFlowProcess()
    {
        $db = eZDB::instance();
        $workflowID = $this->attribute( 'id' );
        $event_list = $this->fetchEvents();
        if ( $event_list != null )
        {
            $existEventIDArray = array();
            foreach ( $event_list as $event )
            {
                $eventID = $event->attribute( 'id' );
                $existEventIDArray[] = $eventID;
            }
            $existEventIDString = implode( ',', $existEventIDArray );
            $db->query( "DELETE FROM ezworkflow_process
                               WHERE workflow_id=$workflowID
                                 AND event_id not in ( $existEventIDString )" );
        }
        else
        {
            $db->query( "DELETE FROM ezworkflow_process WHERE workflow_id=$workflowID" );
        }
    }
903787
def done(self):
        
        logger.info('Marking %s as done', self)

        fn = self.get_path()
        try:
            os.makedirs(os.path.dirname(fn))
        except OSError:
            pass
        open(fn, 'w').close()