Commit adc1a38a authored by Leo Gordon's avatar Leo Gordon
Browse files

renamed for clarity

parent f27c721c
......@@ -139,12 +139,12 @@ sub stderr_file {
return $self->{'_stderr_file'};
}
sub lethal { # Job should set this to 1 prior to dying (or before running code that might cause death - such as RunnableDB's compilation)
# if it believes that the state of things will not allow the Worker to continue normally.
# The Worker will check the flag and commit suicide if it is set to true.
sub lethal_for_worker { # Job should set this to 1 prior to dying (or before running code that might cause death - such as RunnableDB's compilation)
# if it believes that the state of things will not allow the Worker to continue normally.
# The Worker will check the flag and commit suicide if it is set to true.
my $self = shift;
$self->{'_lethal'} = shift if(@_);
return $self->{'_lethal'};
$self->{'_lethal_for_worker'} = shift if(@_);
return $self->{'_lethal_for_worker'};
}
sub print_job {
......
......@@ -124,7 +124,7 @@ sub dangerous_math {
if($value % $divisor == 0) {
if($value>10) { # take the Worker with us into the grave
$self->input_job->lethal(1);
$self->input_job->lethal_for_worker(1);
}
die "Preprogrammed death since $value is a multiple of $divisor";
......
......@@ -517,7 +517,7 @@ sub run
$self->db()->get_JobErrorAdaptor()->register_error($job_id, $error_msg);
$job->update_status('FAILED');
if($job->lethal) { # either a compilation error or other job-sanctioned contamination
if($job->lethal_for_worker) { # either a compilation error or other job-sanctioned contamination
warn "Job's error has contaminated the Worker, so the Worker will now die\n";
$self->cause_of_death('CONTAMINATED');
last BATCHES;
......@@ -593,9 +593,9 @@ sub run_module_with_job {
$self->enter_status('COMPILATION');
$job->update_status('COMPILATION');
$job->lethal(1); # if it dies in this state, it will kill the Worker
$job->lethal_for_worker(1); # if it dies in this state, it will kill the Worker
my $runObj = $self->analysis->process or die "Unknown compilation error";
$job->lethal(0); # not dangerous anymore
$job->lethal_for_worker(0); # not dangerous anymore
my $native_hive_process = $runObj->isa("Bio::EnsEMBL::Hive::Process");
......
......@@ -6,7 +6,7 @@ CREATE TABLE job_error (
worker_id int(10) NOT NULL,
died timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
retry_count int(10) DEFAULT 0 NOT NULL,
status enum('COMPILATION','GET_INPUT','RUN','WRITE_OUTPUT'),
status enum('UNKNOWN','COMPILATION','GET_INPUT','RUN','WRITE_OUTPUT') DEFAULT 'UNKNOWN',
error_msg text,
PRIMARY KEY (analysis_job_id, worker_id, died),
......
......@@ -166,7 +166,7 @@ CREATE TABLE job_error (
worker_id int(10) NOT NULL,
died timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
retry_count int(10) DEFAULT 0 NOT NULL,
status enum('COMPILATION','GET_INPUT','RUN','WRITE_OUTPUT'),
status enum('UNKNOWN', 'COMPILATION', 'GET_INPUT', 'RUN', 'WRITE_OUTPUT') DEFAULT 'UNKNOWN',
error_msg text,
PRIMARY KEY (analysis_job_id, worker_id, died),
......
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