[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OSSTEST PATCH 2/3] host allocation: Check "job class" too



That is all jobs which start with the same \w* as this job.

Signed-off-by: Ian Jackson <iwj@xxxxxxxxxxxxxx>
---
 ts-hosts-allocate-Executive | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/ts-hosts-allocate-Executive b/ts-hosts-allocate-Executive
index 9722ce12..849bc97b 100755
--- a/ts-hosts-allocate-Executive
+++ b/ts-hosts-allocate-Executive
@@ -937,12 +937,20 @@ sub attempt_allocation {
            }
        } elsif (%$starvation_p) {
            my $est_abs = most_optimistic($best, $now, $starvation_p->{I});
-           my ($starving, $m) = starving($est_abs, $now, 0);
+           my $all_starving = 1;
+           foreach my $thisclass (qw(1 0)) {
+               my $tcdesc = $thisclass ? 'class' : 'flight';
+               my ($starving, $m) = starving($est_abs, $now, $thisclass);
+               if (!$starving) {
+                   print DEBUG "not starving ($tcdesc): $m\n";
+                   $all_starving = 0;
+                   last;
+               } else {
+                   logm "starving ($tcdesc) ($m)";
+               }
+           }
            $starvation_q->finish();
-           if (!$starving) {
-               print DEBUG "not starving: $m\n";
-           } else {
-               logm "starving ($m)";
+           if ($all_starving) {
                return $alloc_starved_r;
            }
        }
-- 
2.20.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.