Commit 01a4a985 authored by Leo Gordon's avatar Leo Gordon
Browse files

moved Q:count_running_workers --> RA:count_active_roles

parent 69e94449
......@@ -167,7 +167,7 @@ sub update {
$sql .= ",done_job_count=" . $stats->done_job_count();
$sql .= ",failed_job_count=" . $stats->failed_job_count();
$stats->num_running_workers( $self->db->get_Queen->count_running_workers( $stats->analysis_id() ) );
$stats->num_running_workers( $self->db->get_RoleAdaptor->count_active_roles( $stats->analysis_id() ) );
$sql .= ",num_running_workers=" . $stats->num_running_workers();
}
......
......@@ -95,5 +95,12 @@ sub get_hive_current_load {
}
sub count_active_roles {
my ($self, $analysis_id) = @_;
return $self->count_all( "when_finished IS NULL".($analysis_id ? " AND analysis_id=$analysis_id" : '') );
}
1;
......@@ -667,13 +667,6 @@ sub get_num_failed_analyses {
}
sub count_running_workers {
my ($self, $analysis_id) = @_;
return $self->count_all( "status!='DEAD'".($analysis_id ? " AND analysis_id=$analysis_id" : '') );
}
sub get_workers_rank {
my ($self, $worker) = @_;
......
......@@ -61,9 +61,9 @@ sub schedule_workers_resync_if_necessary {
unless( $total_workers_required ) {
print "\nScheduler: according to analysis_stats no workers are required... let's see if resync can fix it.\n" ;
# FIXME: here is an (optimistic) assumption all Workers the Queen can see are reachable from the Valley:
if( $queen->count_running_workers() != $valley->count_running_workers ) {
print "Scheduler: mismatch between Queen's workers and Valley's workers detected, checking for dead workers...\n";
# FIXME: here is an (optimistic) assumption all Workers the DB knows about are reachable from the Valley:
if( $queen->db->get_RoleAdaptor->count_active_roles() != $valley->count_running_workers ) {
print "Scheduler: mismatch between DB's active Roles and Valley's running Workers detected, checking for dead workers...\n";
$queen->check_for_dead_workers($valley, 1);
}
print "Scheduler: re-balancing of semaphore_counts...\n";
......
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