Skip to content
Snippets Groups Projects
Commit f9f9024e authored by Leo Gordon's avatar Leo Gordon
Browse files

API change: Q::check_nothing_to_run_but_semaphored() now takes an obligatory $list_of_analyses

parent 102cc96f
No related branches found
No related tags found
No related merge requests found
......@@ -620,10 +620,18 @@ sub synchronize_AnalysisStats {
}
sub check_nothing_to_run_but_semaphored { # make sure it is run after a recent sync
my ($self, $filter_analysis) = @_;
=head2 check_nothing_to_run_but_semaphored
Arg [1] : $list_of_analyses
Example : $self->check_nothing_to_run_but_semaphored( [ $analysis_A, $analysis_B ] );
Description: Counts the number of immediately runnable jobs in the given analyses.
Exceptions : none
Caller : Scheduler
my $list_of_analyses = $filter_analysis ? [$filter_analysis] : $self->db->get_AnalysisAdaptor->fetch_all;
=cut
sub check_nothing_to_run_but_semaphored { # make sure it is run after a recent sync
my ($self, $list_of_analyses) = @_;
my $only_semaphored_jobs_to_run = 1;
my $total_semaphored_job_count = 0;
......@@ -649,7 +657,7 @@ sub check_nothing_to_run_but_semaphored { # make sure it is run after a recent
or 1/0, depending on whether $filter_analysis failed or not.
Returntype : int
Exceptions : none
Caller : general
Caller : beekeeper.pl
=cut
......
......@@ -73,7 +73,7 @@ sub schedule_workers_resync_if_necessary {
$queen->synchronize_hive( $list_of_analyses );
if( $queen->db->hive_auto_rebalance_semaphores ) { # make sure rebalancing only ever happens for the pipelines that asked for it
if( $queen->check_nothing_to_run_but_semaphored ) { # and double-check on our side
if( $queen->check_nothing_to_run_but_semaphored( $list_of_analyses ) ) { # and double-check on our side
print "Scheduler: looks like we may need re-balancing semaphore_counts...\n";
if( my $rebalanced_jobs_counter = $queen->db->get_AnalysisJobAdaptor->balance_semaphores( $list_of_analyses ) ) {
print "Scheduler: re-balanced $rebalanced_jobs_counter jobs, going through another re-synchronization...\n";
......
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