From ec576222c41a878d41d651094687e7e13dc9ec32 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Kr=C3=BCger?= Date: Wed, 24 Nov 2010 18:09:13 +0100 Subject: [PATCH] jobd: output progress even when not busy MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- jobd/jobd.pl | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) 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 -- 2.11.4.GIT