From: Jan Krüger Date: Wed, 24 Nov 2010 17:09:13 +0000 (+0100) Subject: jobd: output progress even when not busy X-Git-Url: https://repo.or.cz/w/girocco.git/commitdiff_plain/ec576222c41a878d41d651094687e7e13dc9ec32 jobd: output progress even when not busy Previously, jobd would not output any progress messages if it happened that, at each check, the maximum number of simultaneous jobs was almost reached but not quite. Instead, output progress regardless of how busy (or not) we are. Signed-off-by: Jan Krüger --- diff --git a/jobd/jobd.pl b/jobd/jobd.pl index 54d26a0..86f8209 100755 --- a/jobd/jobd.pl +++ b/jobd/jobd.pl @@ -261,20 +261,21 @@ sub run_queue { while (@queue || @running) { reap_hanging_jobs(); my $proceed_immediately = reap_finished_jobs(); + # Status output + if ($progress && (time - $last_progress) >= 60) { + printf STDERR ts() ."status: %d queued, %d running, %d finished, %d skipped, %d killed\n", scalar(@queue), scalar(@running), $jobs_executed, $jobs_skipped, scalar(@jobs_killed); + if (@running) { + my @run_status; + for (@running) { + push @run_status, _job_name($_)." ". (time - $_->{'started_at'}) ."s"; + } + error("STATUS: currently running: ". join(', ', @run_status)); + } + $last_progress = time; + } # Back off if we're too busy if (@running >= $max_par || have_intensive_jobs() >= $max_par_intensive || !@queue) { sleep 1 unless $proceed_immediately; - if ($progress && (time - $last_progress) >= 60) { - printf STDERR ts() ."STATUS: %d queued, %d running, %d finished, %d skipped, %d killed\n", scalar(@queue), scalar(@running), $jobs_executed, $jobs_skipped, scalar(@jobs_killed); - if (@running) { - my @run_status; - for (@running) { - push @run_status, _job_name($_)." ". (time - $_->{'started_at'}) ."s"; - } - error("STATUS: currently running: ". join(', ', @run_status)); - } - $last_progress = time; - } next; } # Run next