Commit c01a3433 authored by Jessica Severin's avatar Jessica Severin
Browse files

added code to catch an exception at the job level, reset/fail that job

yet allow the worker to continue working.  Previous design killed the worker
when one of it's jobs fails.  This new design should be more efficient yet
still provide some level of inter-job-mangle-proof-ness.
parent e4dded05
......@@ -418,15 +418,21 @@ sub run
}
foreach my $job (@{$jobs}) {
$self->redirect_job_output($job);
$self->run_module_with_job($job);
$self->close_and_update_job_output($job);
$self->queen->worker_register_job_done($self, $job);
$self->{'_work_done'}++;
eval {
$self->redirect_job_output($job);
$self->run_module_with_job($job);
$self->close_and_update_job_output($job);
$self->queen->worker_register_job_done($self, $job);
$self->work_done($self->work_done + 1);
};
if($@) {
#job threw an exception so it had a problem
printf("job %d failed with exception: $@\n", $job->dbID);
$self->queen->db->get_AnalysisJobAdaptor->reset_dead_job_by_dbID($job->dbID);
}
}
my $batch_end = time() * 1000;
#printf("batch start:%f end:%f\n", $batch_start, $batch_end);
$self->db->get_AnalysisStatsAdaptor->
......
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