[PATCH 1/4] testbot/Engine: Make sure not to schedule jobs on VMs undergoing maintenance!

Francois Gouget fgouget at codeweavers.com
Tue Sep 10 04:07:52 CDT 2019


After a series of revert failures the scheduler would put the VM in
maintenance mode but still put it in the list of VMs that can be
reverted to run a new task.
Now such VMs are put in the busy list so no task is scheduled on them.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 testbot/lib/WineTestBot/Engine/Scheduler.pm | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/testbot/lib/WineTestBot/Engine/Scheduler.pm b/testbot/lib/WineTestBot/Engine/Scheduler.pm
index 3ce90895..1b42ea9a 100644
--- a/testbot/lib/WineTestBot/Engine/Scheduler.pm
+++ b/testbot/lib/WineTestBot/Engine/Scheduler.pm
@@ -274,15 +274,22 @@ sub _CheckAndClassifyVMs()
         {
           my $Errors = ($VM->Errors || 0) + 1;
           $VM->Errors($Errors);
-          $NewStatus = "maintenance" if ($Errors >= $MaxVMErrors);
+          if ($Errors >= $MaxVMErrors)
+          {
+            $NewStatus = "maintenance";
+            $Sched->{busyvms}->{$VMKey} = 1;
+          }
         }
         $VM->Status($NewStatus);
         $VM->KillChild();
         $VM->Save();
         $VM->RecordResult($Sched->{records}, "boterror stuck process");
-        $Sched->{lambvms}->{$VMKey} = 1;
-        $Host->{dirty}++;
-        $Host->{active}++;
+        if ($NewStatus eq "dirty")
+        {
+          $Sched->{lambvms}->{$VMKey} = 1;
+          $Host->{dirty}++;
+          $Host->{active}++;
+        }
       }
       elsif ($VM->Status =~ /^(?:dirty|running|reverting)$/)
       {
-- 
2.20.1




More information about the wine-devel mailing list