]> xenbits.xensource.com Git - people/royger/osstest.git/commitdiff
starvation: Do not give up if there are other jobs running
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 26 Jun 2019 10:44:48 +0000 (11:44 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Tue, 2 Jul 2019 16:27:18 +0000 (17:27 +0100)
We want those other jobs to finish so that we can include the time
they took, and the fact that they completed, in our calculations.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
ts-hosts-allocate-Executive

index 6b3da6006957881a03f4c71eb73f50163547d5e4..079ef1d16cccced0cbc8fd7fc162e8d6da3c6bdf 100755 (executable)
@@ -788,9 +788,17 @@ sub starving ($$) {
     my $maxfin=0;
     while (my ($j,$st,$fin) = $starvation_q->fetchrow_array()) {
        if ($st eq 'preparing' ||
-           $st eq 'queued' ||
-           $st eq 'running') {
+           $st eq 'queued') {
            $w++;
+       } elsif ($st eq 'running') {
+           # We don't quit if there are still jobs running.  Instead
+           # we wait until they are done and then see if how much we
+           # would be delaying their results.  This does mean that a
+           # flight can be kept going, rather than being treated as
+           # starved, by a constant trickle of late jobs.  But that
+           # is indistinguishable from a flight which is at the head
+           # of the queue for a small set of resources.
+           return (0, "job $j status $st, don't give up just yet");
        } else {
            $d++;
            return (0, "job $j status $st but no step finished time!")