Commit 10e3563a authored by Leo Gordon's avatar Leo Gordon
Browse files

(patch offered by Matthieu) Allow the Job to kill the Worker even on succecss

parent d6f28cf1
......@@ -568,6 +568,7 @@ sub run {
);
}
# FIXME: The following check is not *completely* correct, as it assumes hive_capacity is "local" to the analysis:
if (!$self->cause_of_death
and 0 <= $self->analysis->stats->hive_capacity
and $self->analysis->stats->hive_capacity < $self->analysis->stats->num_running_workers
......@@ -697,6 +698,12 @@ sub run_one_batch {
if(my $semaphored_job_id = $job->semaphored_job_id) {
$job->adaptor->decrease_semaphore_count_for_jobid( $semaphored_job_id ); # step-unblock the semaphore
}
if($job->lethal_for_worker) {
warn "The Job, although complete, wants the Worker to die\n";
$self->cause_of_death('CONTAMINATED');
return $jobs_done_here;
}
}
$self->prev_job_error( $job->incomplete );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment