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

Introduced a new 'NO_ROLE' cause_of_death for failures during specialization...

Introduced a new 'NO_ROLE' cause_of_death for failures during specialization (not so much of an error, really!)
parent 704ea8cc
......@@ -254,15 +254,15 @@ sub specialize_new_worker {
die "Analysis is DONE, and doesn't require workers";
}
}
} else { # probably scheduled by beekeeper.pl
$stats = $self->suggest_analysis_to_specialize_by_rc_id_meadow_type($worker->resource_class_id, $worker->meadow_type)
or die "Queen failed to pick an analysis for the worker";
# probably scheduled by beekeeper.pl:
} elsif( $stats = $self->suggest_analysis_to_specialize_by_rc_id_meadow_type($worker->resource_class_id, $worker->meadow_type) ) {
print "Queen picked analysis with dbID=".$stats->analysis_id." for the worker\n";
$analysis_id = $stats->analysis_id;
} else {
$worker->cause_of_death('NO_ROLE');
die "No analysis suitable for the worker was found\n";
}
# now set it in the $worker:
......@@ -323,6 +323,7 @@ sub register_worker_death {
or $cod eq 'RUNLIMIT'
or $cod eq 'KILLED_BY_USER'
or $cod eq 'SEE_MSG'
or $cod eq 'NO_ROLE'
or $cod eq 'CONTAMINATED') {
$self->db->get_AnalysisJobAdaptor->release_undone_jobs_from_worker($worker);
}
......
......@@ -523,8 +523,8 @@ sub run {
$min_batch_time = $self->analysis->stats->min_batch_time();
1;
} or do {
my $msg = "Could not specialize worker:\n\t".$@;
warn "$msg\n";
my $msg = $@;
warn "Could not specialize worker:\n\t$msg\n";
$self->adaptor->db->get_JobMessageAdaptor()->store_worker_message($self->dbID, $msg, 1 );
$self->cause_of_death('SEE_MSG') unless($self->cause_of_death()); # some specific causes could have been set prior to die "...";
......
# add 'NO_ROLE' cause_of_death specifically for workers that could not specialize
ALTER TABLE worker MODIFY COLUMN cause_of_death enum('NO_ROLE', 'NO_WORK', 'JOB_LIMIT', 'HIVE_OVERLOAD', 'LIFESPAN', 'CONTAMINATED', 'KILLED_BY_USER', 'MEMLIMIT', 'RUNLIMIT', 'SEE_MSG', 'UNKNOWN') DEFAULT NULL;
......@@ -85,7 +85,7 @@ CREATE TABLE worker (
born timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
last_check_in datetime NOT NULL,
died datetime DEFAULT NULL,
cause_of_death enum('NO_WORK', 'JOB_LIMIT', 'HIVE_OVERLOAD', 'LIFESPAN', 'CONTAMINATED', 'KILLED_BY_USER', 'MEMLIMIT', 'RUNLIMIT', 'SEE_MSG', 'UNKNOWN') DEFAULT NULL,
cause_of_death enum('NO_ROLE', 'NO_WORK', 'JOB_LIMIT', 'HIVE_OVERLOAD', 'LIFESPAN', 'CONTAMINATED', 'KILLED_BY_USER', 'MEMLIMIT', 'RUNLIMIT', 'SEE_MSG', 'UNKNOWN') DEFAULT NULL,
log_dir varchar(255) DEFAULT NULL,
PRIMARY KEY (worker_id),
......
......@@ -77,7 +77,7 @@ CREATE TABLE worker (
born timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
last_check_in datetime NOT NULL,
died datetime DEFAULT NULL,
cause_of_death TEXT DEFAULT NULL, /* enum('NO_WORK', 'JOB_LIMIT', 'HIVE_OVERLOAD', 'LIFESPAN', 'CONTAMINATED', 'KILLED_BY_USER', 'MEMLIMIT', 'RUNLIMIT', 'SEE_MSG', 'UNKNOWN') DEFAULT NULL */
cause_of_death TEXT DEFAULT NULL, /* enum('NO_ROLE', 'NO_WORK', 'JOB_LIMIT', 'HIVE_OVERLOAD', 'LIFESPAN', 'CONTAMINATED', 'KILLED_BY_USER', 'MEMLIMIT', 'RUNLIMIT', 'SEE_MSG', 'UNKNOWN') DEFAULT NULL */
log_dir varchar(80) DEFAULT NULL
);
......
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