Commit 2c7f73ae authored by Leo Gordon's avatar Leo Gordon
Browse files

If greedy disoriented Workers overshoot analysis_capacity|hive_capacity, make...

If greedy disoriented Workers overshoot analysis_capacity|hive_capacity, make sure they respecialize after the first batch
parent 3d3a69be
......@@ -559,12 +559,10 @@ sub run {
);
}
# A mechanism whereby workers can be caused to exit even if they were doing fine:
#
# FIXME: The following check is not *completely* correct, as it assumes hive_capacity is "local" to the analysis:
# A mechanism whereby workers can be caused to exit even if they were doing fine:
if (!$self->cause_of_death) {
my $stats = $self->analysis->stats;
if( defined($stats->hive_capacity) && (0 <= $stats->hive_capacity) && ($stats->hive_capacity < $stats->num_running_workers)
my $stats = $self->analysis->stats; # make sure it is fresh from the DB
if( defined($stats->hive_capacity) && (0 <= $stats->hive_capacity) && ($self->adaptor->get_hive_current_load >= 1.1)
or defined($self->analysis->analysis_capacity) && (0 <= $self->analysis->analysis_capacity) && ($self->analysis->analysis_capacity < $stats->num_running_workers)
) {
$self->cause_of_death('HIVE_OVERLOAD');
......@@ -572,10 +570,13 @@ sub run {
}
if( $self->cause_of_death() =~ /^(NO_WORK|HIVE_OVERLOAD)$/ ) {
$self->adaptor->db->get_AnalysisStatsAdaptor->update_status($self->analysis_id, 'ALL_CLAIMED');
if( $self->cause_of_death() eq 'NO_WORK') {
$self->adaptor->db->get_AnalysisStatsAdaptor->update_status($self->analysis_id, 'ALL_CLAIMED');
}
if( $self->can_respecialize and !$specialization_arglist ) {
$self->cause_of_death(undef);
$self->adaptor->db->get_AnalysisStatsAdaptor->decrease_running_workers($self->analysis->dbID); # FIXME: tidy up this counting of active roles
$self->specialize_and_compile_wrapper();
}
}
......
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