Skip to contentSkip to conversation

Host allocation scoring improvements

PATCH In review Ian Jackson 2 participants 17 messages Nov 11, 2014 – Nov 14, 2014

lore
Share & tools
lore
#0 lore raw

cover Host allocation scoring improvements

Here, I'm trying to fix the way that osstest gets far too obsessed about particular failing hosts.

1/9 cs-adjust-flight: Fix doc about /<pcre> to match 2/9 ts-hosts-allocate-Executive: allow uncompressed 3/9 Osstest/Executive.pm: Debug log same-host status 4/9 ts-hosts-allocate-Executive: Move $variation_age 5/9 ts-hosts-allocate-Executive: Do not prefer fast 6/9 ts-hosts-allocate-Executive: Clarify an 7/9 ts-hosts-allocate-Executive: Score for 8/9 ts-hosts-allocate-Executive: Redo
9/9 ts-hosts-allocate-Executive: Radically reduce

#1 lore raw

PATCH 1/9 cs-adjust-flight: Fix doc about /<pcre> to match implementation

---
 cs-adjust-flight |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
cs-adjust-flight +1 -1
index 663ca6f..7ec17e3 100755
@@ -18,7 +18,7 @@
 #   <foo-name>
 #   .                 means all jobs
 #   ^<pcre>           means $foo =~ m/^<pcre>/
-#   /<pcre>/          means $foo =~ m/<pcre>/
+#   /<pcre>           means $foo =~ m/<pcre>/
 
 # This is part of "osstest", an automated testing framework for Xen.
 # Copyright (C) 2009-2013 Citrix Inc.
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 2/9 ts-hosts-allocate-Executive: allow uncompressed log

In reply to Ian Jackson
---
 ts-hosts-allocate-Executive |   20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)
ts-hosts-allocate-Executive +13 -7
index 0e9c193..73c1a45 100755
@@ -29,12 +29,14 @@ tsreadconfig();
 
 open DEBUG, ">/dev/null" or die $!;
 
+our $compressdebug=1;
+
 while (@ARGV and $ARGV[0] =~ m/^-/) {
     $_= shift @ARGV;
     last if m/^--$/;
     while (m/^-./) {
-        if (0) {
-	    # no options
+        if (s/^-U/-/) {
+	    $compressdebug=0;
         } else {
             die "$_ ?";
         }
@@ -60,12 +62,16 @@ sub setup () {
 
     $taskid= findtask();
 
-    my $logbase = "hosts-allocate.debug.gz";
+    my $logbase = "hosts-allocate.debug".($compressdebug?".gz":"");
     my $logfh = open_unique_stashfile \$logbase;
-    my $logchild = open DEBUG, "|-";  defined $logchild or die $!;
-    if (!$logchild) {
-	open STDOUT, ">&", $logfh or die $!;
-	exec "gzip" or die $!;
+    if ($compressdebug) {
+	my $logchild = open DEBUG, "|-";  defined $logchild or die $!;
+	if (!$logchild) {
+	    open STDOUT, ">&", $logfh or die $!;
+	    exec "gzip" or die $!;
+	}
+    } else {
+	open DEBUG, ">&", $logfh or die $!;
     }
     DEBUG->autoflush(1);
     logm("host allocation debug log in $logbase");
Signature · 1 line
1.7.10.4
#3 lore raw

PATCH 3/9 Osstest/Executive.pm: Debug log same-host status (in duration estimator)

In reply to Ian Jackson
---
 Osstest/Executive.pm |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Osstest/Executive.pm +2 -1
index 2a3cc7c..3dc37d1 100644
@@ -733,7 +733,8 @@ END
             my ($duration) = $duration_duration_q->fetchrow_array();
             $duration_duration_q->finish();
             if ($duration) {
-                $dbg->("REF $ref->{flight} DURATION $duration");
+                $dbg->("REF $ref->{flight} DURATION $duration ".
+		       ($ref->{status} // ''));
                 $duration_max= $duration
                     if $duration > $duration_max;
             }
Signature · 1 line
1.7.10.4
#4 lore raw

PATCH 4/9 ts-hosts-allocate-Executive: Move $variation_age setting

In reply to Ian Jackson

We are going to want to put more stuff in here which depends on $duration_rightaway_adjust.

No functional change in this commit.

---
 ts-hosts-allocate-Executive |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
ts-hosts-allocate-Executive +6 -6
index 73c1a45..67b8891 100755
@@ -478,12 +478,6 @@ sub hid_recurse ($$) {
 
     print DEBUG "$dbg EVAL DURATION $duration va=$variation_age\n";
 
-    if ($jobinfo->{recipe} =~ m/build/) {
-        $variation_age= 0;
-    } elsif ($variation_age > 5*86400) {
-	$variation_age= 5*86400;
-    }	
-
     my @requestlist;
     foreach my $hid (@hids) {
         my $req= {
@@ -502,6 +496,12 @@ sub hid_recurse ($$) {
 
     $duration_rightaway_adjust=0 if $start_time;
 
+    if ($jobinfo->{recipe} =~ m/build/) {
+        $variation_age= 0;
+    } elsif ($variation_age > 5*86400) {
+	$variation_age= 5*86400;
+    }
+
     my $cost= $start_time
 	+ $duration
 	+ $duration_rightaway_adjust
Signature · 1 line
1.7.10.4
#5 lore raw

PATCH 5/9 ts-hosts-allocate-Executive: Do not prefer fast hosts for tests

In reply to Ian Jackson

Introduce $duration_for_cost and set it to the previous formula for build jobs, or 0 for test jobs.

---
 ts-hosts-allocate-Executive |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
ts-hosts-allocate-Executive +3 -2
index 67b8891..fc54cda 100755
@@ -496,15 +496,16 @@ sub hid_recurse ($$) {
 
     $duration_rightaway_adjust=0 if $start_time;
 
+    my $duration_for_cost = 0;
     if ($jobinfo->{recipe} =~ m/build/) {
         $variation_age= 0;
+	$duration_for_cost= $duration + $duration_rightaway_adjust;
     } elsif ($variation_age > 5*86400) {
 	$variation_age= 5*86400;
     }
 
     my $cost= $start_time
-	+ $duration
-	+ $duration_rightaway_adjust
+	+ $duration_for_cost
         - $previously_failed * 366*86400
         + ($previously_failed ? + $variation_age * 10 : - $variation_age / 30)
 	- $share_reuse * 10000;
Signature · 1 line
1.7.10.4
#6 lore raw

PATCH 6/9 ts-hosts-allocate-Executive: Clarify an expression with //

In reply to Ian Jackson

No functional change.

---
 ts-hosts-allocate-Executive |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
ts-hosts-allocate-Executive +1 -2
index fc54cda..9562a0a 100755
@@ -464,8 +464,7 @@ sub hid_recurse ($$) {
 	    !defined($duration) ||
 	    defined($cand->{Duration}) && $cand->{Duration} >= $duration;
         $previously_failed++ if
-	    defined $cand->{MostRecentStatus} &&
-	    $cand->{MostRecentStatus} eq 'fail';
+	    ($cand->{MostRecentStatus} // '') eq 'fail';
     }
     my $duration_rightaway_adjust= 0;
     
Signature · 1 line
1.7.10.4
#7 lore raw

PATCH 7/9 ts-hosts-allocate-Executive: Score for equivalent previous failures

In reply to Ian Jackson

Look to see whether the last run on any hosts which are equivalent to the ones we're looking at, failed. This means that when host X is failing and we are considering host Y which is equivalent to X, we give Y a selection bonus.

This means that osstest will be less obsessive about sticking to the very same failing host.

---
 ts-hosts-allocate-Executive |   45 +++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 43 insertions(+), 2 deletions(-)
ts-hosts-allocate-Executive +43 -2
index 9562a0a..24f78d3 100755
@@ -284,6 +284,29 @@ END
         $findhostsq->execute("blessed-$fi->{intended}");
     }
 
+    my $equivstatusq= $dbh_tests->prepare(<<END);
+            SELECT flight, job, val, status
+	      FROM flights f
+	      JOIN jobs j USING (flight)
+	      JOIN runvars r USING (flight,job)
+             WHERE j.job=?
+               AND f.blessing=?
+	       AND f.branch=?
+               AND r.name=?
+	       AND r.val IN (
+		   SELECT hostname
+		     FROM hostflags
+		    WHERE hostflag IN (
+			  SELECT hostflag
+			    FROM hostflags
+			   WHERE hostname=?
+			     AND hostflag LIKE 'equiv-%'
+		       )
+		   )
+	  ORDER BY f.started DESC
+	     LIMIT 1;
+END
+
     my @candidates;
     my $any=0;
 
@@ -342,6 +365,17 @@ END
 
         find_recent_duration($dbg,$hid,$candrow);
 
+	if ($candrow->{restype} eq 'host') {
+	    $equivstatusq->execute($job,$fi->{intended},$fi->{branch},
+				   $hid->{Ident},$candrow->{resname});
+	    my $esrow = $equivstatusq->fetchrow_hashref();
+	    $candrow->{EquivMostRecentStatus} = $esrow->{status};
+	    print DEBUG "$dbg EQUIV-MOST-RECENT ";
+	    print DEBUG ("$esrow->{flight}.$esrow->{job}".
+			 " $esrow->{val} $esrow->{status}") if $esrow;
+	    print DEBUG ".\n";
+	}
+
         foreach my $kcomb (qw(Shared-Max-Wear Shared-Max-Tasks)) {
             my $kdb= $kcomb;  $kdb =~ y/-A-Z/ a-z/;
             my $khash= $kcomb;  $khash =~ y/-//d;
@@ -362,6 +396,7 @@ END
 	print DEBUG "$dbg CANDIDATE.\n";
     }
     $findhostsq->finish();
+    $equivstatusq->finish();
 
     if (!@candidates) {
         if (defined $use) {
@@ -455,6 +490,7 @@ sub hid_recurse ($$) {
     my $variation_age= 0;
     my $duration= undef;
     my $previously_failed = 0;
+    my $previously_failed_equiv = 0;
     foreach my $hid (@hids) {
 	my $cand= $hid->{Selected};
 	my $recentstarted= $cand->{MostRecentStarted};
@@ -465,6 +501,8 @@ sub hid_recurse ($$) {
 	    defined($cand->{Duration}) && $cand->{Duration} >= $duration;
         $previously_failed++ if
 	    ($cand->{MostRecentStatus} // '') eq 'fail';
+	$previously_failed_equiv++ if
+	    ($cand->{EquivMostRecentStatus} // '') eq 'fail';
     }
     my $duration_rightaway_adjust= 0;
     
@@ -505,12 +543,15 @@ sub hid_recurse ($$) {
 
     my $cost= $start_time
 	+ $duration_for_cost
-        - $previously_failed * 366*86400
+        - ($previously_failed      ==@hids ? 366*86400 :
+	   $previously_failed_equiv==@hids ? 365*86400 :
+	   0)
         + ($previously_failed ? + $variation_age * 10 : - $variation_age / 30)
 	- $share_reuse * 10000;
     
     print DEBUG "$dbg FINAL start=$start_time va=$variation_age".
-        " previously_failed=$previously_failed cost=$cost\n";
+        " previously_failed=$previously_failed".
+	" previously_failed_equiv=$previously_failed_equiv cost=$cost\n";
 
     if (!defined $best || $cost < $best->{Cost}) {
         print DEBUG "$dbg FINAL BEST: ".
Signature · 1 line
1.7.10.4
#8 lore raw

Re: [OSSTEST PATCH 7/9] ts-hosts-allocate-Executive: Score for equivalent previous failures

Quoted 48 lines · Ian Jackson

Look to see whether the last run on any hosts which are equivalent to the ones we're looking at, failed. This means that when host X is failing and we are considering host Y which is equivalent to X, we give Y a selection bonus.

This means that osstest will be less obsessive about sticking to the very same failing host.

---
 ts-hosts-allocate-Executive |   45 +++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 43 insertions(+), 2 deletions(-)
ts-hosts-allocate-Executive +23 -0
index 9562a0a..24f78d3 100755
@@ -284,6 +284,29 @@ END
         $findhostsq->execute("blessed-$fi->{intended}");
     }
 
+    my $equivstatusq= $dbh_tests->prepare(<<END);
+            SELECT flight, job, val, status
+	      FROM flights f
+	      JOIN jobs j USING (flight)
+	      JOIN runvars r USING (flight,job)
+             WHERE j.job=?
+               AND f.blessing=?
+	       AND f.branch=?
+               AND r.name=?
+	       AND r.val IN (
+		   SELECT hostname
+		     FROM hostflags
+		    WHERE hostflag IN (
+			  SELECT hostflag
+			    FROM hostflags
+			   WHERE hostname=?
+			     AND hostflag LIKE 'equiv-%'
+		       )
+		   )
+	  ORDER BY f.started DESC
+	     LIMIT 1;
+END
+
     my @candidates;
     my $any=0;
 

ts-hosts-allocate-Executive END · line 371

Quoted 7 lines
ts-hosts-allocate-Executive +4 -0
@@ -342,6 +365,17 @@ END
 
         find_recent_duration($dbg,$hid,$candrow);
 
+	if ($candrow->{restype} eq 'host') {
+	    $equivstatusq->execute($job,$fi->{intended},$fi->{branch},
+				   $hid->{Ident},$candrow->{resname});
+	    my $esrow = $equivstatusq->fetchrow_hashref();

For the first flight on a new branch (or perhaps a new blessing), this will return an undef, because there is no previous flight to match, won't it?

http://search.cpan.org/~timb/DBI-1.632/DBI.pm#fetchrow_hashref says if you get an undef you should check $equivstatusq->err to see if that was due to an error vs. empty result set. Not sure if you'll care given this is all heuristics though.

ts-hosts-allocate-Executive END · line 372

Quoted 1 line
ts-hosts-allocate-Executive +1 -0
+	    $candrow->{EquivMostRecentStatus} = $esrow->{status};

Meaning this will fail, or perhaps just produce a warning.

ts-hosts-allocate-Executive END · line 376

Quoted 4 lines
ts-hosts-allocate-Executive +4 -0
+	    print DEBUG "$dbg EQUIV-MOST-RECENT ";
+	    print DEBUG ("$esrow->{flight}.$esrow->{job}".
+			 " $esrow->{val} $esrow->{status}") if $esrow;
+	    print DEBUG ".\n";

And so will these?

Quoted 31 lines
ts-hosts-allocate-Executive +6 -0
+	}
+
         foreach my $kcomb (qw(Shared-Max-Wear Shared-Max-Tasks)) {
             my $kdb= $kcomb;  $kdb =~ y/-A-Z/ a-z/;
             my $khash= $kcomb;  $khash =~ y/-//d;
@@ -362,6 +396,7 @@ END
 	print DEBUG "$dbg CANDIDATE.\n";
     }
     $findhostsq->finish();
+    $equivstatusq->finish();
 
     if (!@candidates) {
         if (defined $use) {
@@ -455,6 +490,7 @@ sub hid_recurse ($$) {
     my $variation_age= 0;
     my $duration= undef;
     my $previously_failed = 0;
+    my $previously_failed_equiv = 0;
     foreach my $hid (@hids) {
 	my $cand= $hid->{Selected};
 	my $recentstarted= $cand->{MostRecentStarted};
@@ -465,6 +501,8 @@ sub hid_recurse ($$) {
 	    defined($cand->{Duration}) && $cand->{Duration} >= $duration;
         $previously_failed++ if
 	    ($cand->{MostRecentStatus} // '') eq 'fail';
+	$previously_failed_equiv++ if
+	    ($cand->{EquivMostRecentStatus} // '') eq 'fail';
     }
     my $duration_rightaway_adjust= 0;
 

ts-hosts-allocate-Executive sub hid_recurse ($$) { · line 548

Quoted 7 lines
ts-hosts-allocate-Executive +3 -1
@@ -505,12 +543,15 @@ sub hid_recurse ($$) {
 
     my $cost= $start_time
 	+ $duration_for_cost
-        - $previously_failed * 366*86400
+        - ($previously_failed      ==@hids ? 366*86400 :
+	   $previously_failed_equiv==@hids ? 365*86400 :
+	   0)

You've dropped the behaviour of multiplying 366*86400 by $previously_failed, was that intentional?

I think you've also gone to giving a bonus at all only if all @hids previously failed, instead of just at least one of them.

Quoted 10 lines
ts-hosts-allocate-Executive +2 -1
         + ($previously_failed ? + $variation_age * 10 : - $variation_age / 30)
 	- $share_reuse * 10000;
 
     print DEBUG "$dbg FINAL start=$start_time va=$variation_age".
-        " previously_failed=$previously_failed cost=$cost\n";
+        " previously_failed=$previously_failed".
+	" previously_failed_equiv=$previously_failed_equiv cost=$cost\n";
 
     if (!defined $best || $cost < $best->{Cost}) {
         print DEBUG "$dbg FINAL BEST: ".
#9 lore raw

Re: [OSSTEST PATCH 7/9] ts-hosts-allocate-Executive: Score for equivalent previous failures

Ian Campbell writes ("Re: [OSSTEST PATCH 7/9] ts-hosts-allocate-Executive: Score for equivalent previous failures"):

Quoted 9 lines · Ian Jackson

ts-hosts-allocate-Executive END · line 371

Quoted 4 lines
ts-hosts-allocate-Executive +4 -0
+	if ($candrow->{restype} eq 'host') {
+	    $equivstatusq->execute($job,$fi->{intended},$fi->{branch},
+				   $hid->{Ident},$candrow->{resname});
+	    my $esrow = $equivstatusq->fetchrow_hashref();

For the first flight on a new branch (or perhaps a new blessing), this will return an undef, because there is no previous flight to match, won't it?

Yes.

Quoted 4 lines

http://search.cpan.org/~timb/DBI-1.632/DBI.pm#fetchrow_hashref says if you get an undef you should check $equivstatusq->err to see if that was due to an error vs. empty result set. Not sure if you'll care given this is all heuristics though.

We turn on the automatic error trapping during db setup, so errors helpfully turn into die.

Quoted 3 lines

ts-hosts-allocate-Executive END · line 372

Quoted 1 line
ts-hosts-allocate-Executive +1 -0
+	    $candrow->{EquivMostRecentStatus} = $esrow->{status};

Meaning this will fail, or perhaps just produce a warning.

$ perl -MData::Dumper -we 'use strict; my $y; print Dumper($y->{foo});'
$VAR1 = undef;
$
Quoted 6 lines

ts-hosts-allocate-Executive END · line 376

Quoted 4 lines
ts-hosts-allocate-Executive +4 -0
+	    print DEBUG "$dbg EQUIV-MOST-RECENT ";
+	    print DEBUG ("$esrow->{flight}.$esrow->{job}".
+			 " $esrow->{val} $esrow->{status}") if $esrow;
+	    print DEBUG ".\n";

And so will these?

if $esrow;

Quoted 11 lines

ts-hosts-allocate-Executive sub hid_recurse ($$) { · line 548

Quoted 8 lines
ts-hosts-allocate-Executive +3 -1
@@ -505,12 +543,15 @@ sub hid_recurse ($$) {
 
     my $cost= $start_time
 	+ $duration_for_cost
-        - $previously_failed * 366*86400
+        - ($previously_failed      ==@hids ? 366*86400 :
+	   $previously_failed_equiv==@hids ? 365*86400 :
+	   0)

You've dropped the behaviour of multiplying 366*86400 by $previously_failed, was that intentional?

Yes. $previously_failed was the number of candidate hosts which had previous failures. Making the offset proportional to the number of hosts in the test is daft.

Quoted 2 lines

I think you've also gone to giving a bonus at all only if all @hids previously failed, instead of just at least one of them.

Yes.

Should I write this better in the commit message ?

Ian.

#10 lore raw

PATCH 8/9 ts-hosts-allocate-Executive: Redo variation_bonus scoring

In reply to Ian Jackson

Use a logarithmic scale. Cap the bonus at 12h rather than 5d/30 = 4h. When we have previously failed, make sure we apply a reverse bonus, rather than a penalty.

---
 ts-hosts-allocate-Executive |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
ts-hosts-allocate-Executive +9 -3
index 24f78d3..590fe98 100755
@@ -537,19 +537,25 @@ sub hid_recurse ($$) {
     if ($jobinfo->{recipe} =~ m/build/) {
         $variation_age= 0;
 	$duration_for_cost= $duration + $duration_rightaway_adjust;
-    } elsif ($variation_age > 5*86400) {
-	$variation_age= 5*86400;
     }
 
+    my $log_variation_age = log(1+$variation_age/86400);
+    my $variation_bonus = $log_variation_age * 3600*2;
+    my $max_variation_bonus = 12*86400;
+    $variation_bonus=$max_variation_bonus
+	if $variation_bonus>$max_variation_bonus;
+
     my $cost= $start_time
 	+ $duration_for_cost
         - ($previously_failed      ==@hids ? 366*86400 :
 	   $previously_failed_equiv==@hids ? 365*86400 :
 	   0)
-        + ($previously_failed ? + $variation_age * 10 : - $variation_age / 30)
+        + ($previously_failed || $previously_failed_equiv
+	   ? (-$max_variation_bonus+$variation_bonus) : -$variation_bonus)
 	- $share_reuse * 10000;
     
     print DEBUG "$dbg FINAL start=$start_time va=$variation_age".
+	" variation_bonus=$variation_bonus".
         " previously_failed=$previously_failed".
 	" previously_failed_equiv=$previously_failed_equiv cost=$cost\n";
 
Signature · 1 line
1.7.10.4
#11 lore raw

Re: [OSSTEST PATCH 8/9] ts-hosts-allocate-Executive: Redo variation_bonus scoring

Quoted 14 lines · Ian Jackson

Use a logarithmic scale. Cap the bonus at 12h rather than 5d/30 = 4h. When we have previously failed, make sure we apply a reverse bonus, rather than a penalty.

---
 ts-hosts-allocate-Executive |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
ts-hosts-allocate-Executive +0 -0
index 24f78d3..590fe98 100755

ts-hosts-allocate-Executive sub hid_recurse ($$) { · line 544

Quoted 10 lines
ts-hosts-allocate-Executive +3 -2
@@ -537,19 +537,25 @@ sub hid_recurse ($$) {
     if ($jobinfo->{recipe} =~ m/build/) {
         $variation_age= 0;
 	$duration_for_cost= $duration + $duration_rightaway_adjust;
-    } elsif ($variation_age > 5*86400) {
-	$variation_age= 5*86400;
     }
 
+    my $log_variation_age = log(1+$variation_age/86400);
+    my $variation_bonus = $log_variation_age * 3600*2;
+    my $max_variation_bonus = 12*86400;

Isn't that 12 days, rather than the 12 hours in the commit log?

Or are the units here something other than seconds? (in which case I'm v. confused by what time() returns...)

Quoted 18 lines
ts-hosts-allocate-Executive +6 -1
+    $variation_bonus=$max_variation_bonus
+	if $variation_bonus>$max_variation_bonus;
+
     my $cost= $start_time
 	+ $duration_for_cost
         - ($previously_failed      ==@hids ? 366*86400 :
 	   $previously_failed_equiv==@hids ? 365*86400 :
 	   0)
-        + ($previously_failed ? + $variation_age * 10 : - $variation_age / 30)
+        + ($previously_failed || $previously_failed_equiv
+	   ? (-$max_variation_bonus+$variation_bonus) : -$variation_bonus)
 	- $share_reuse * 10000;
 
     print DEBUG "$dbg FINAL start=$start_time va=$variation_age".
+	" variation_bonus=$variation_bonus".
         " previously_failed=$previously_failed".
 	" previously_failed_equiv=$previously_failed_equiv cost=$cost\n";
 
#12 lore raw

Re: [OSSTEST PATCH 8/9] ts-hosts-allocate-Executive: Redo variation_bonus scoring

Ian Campbell writes ("Re: [OSSTEST PATCH 8/9] ts-hosts-allocate-Executive: Redo variation_bonus scoring"):

Quoted 6 lines · Ian Jackson

ts-hosts-allocate-Executive sub hid_recurse ($$) { · line 544

Quoted 3 lines
ts-hosts-allocate-Executive +3 -0
+    my $log_variation_age = log(1+$variation_age/86400);
+    my $variation_bonus = $log_variation_age * 3600*2;
+    my $max_variation_bonus = 12*86400;

Isn't that 12 days, rather than the 12 hours in the commit log?

Well spotted. I made that mistake deliberately, honest.

Thanks for the review!

Ian.

#13 lore raw

PATCH 9/9 ts-hosts-allocate-Executive: Radically reduce the previously_failed bonus

In reply to Ian Jackson

Make osstest less obsessive about sticking to failing hosts if they are persistently unavailable.

---
 ts-hosts-allocate-Executive |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
ts-hosts-allocate-Executive +6 -2
index 590fe98..1378f25 100755
@@ -547,8 +547,12 @@ sub hid_recurse ($$) {
 
     my $cost= $start_time
 	+ $duration_for_cost
-        - ($previously_failed      ==@hids ? 366*86400 :
-	   $previously_failed_equiv==@hids ? 365*86400 :
+        - ($previously_failed      ==@hids ?   7*86400 :
+	   $previously_failed_equiv==@hids ? 6.5*86400 :
+	   # We wait 7d extra to try a failing test on the same
+	   # hardware, or 6.5d on `equivalent' hardware (as defined by
+	   # equiv-* flags).  Compared to `equivalent' hardware, we
+	   # wait 12h to try it on exactly the same.
 	   0)
         + ($previously_failed || $previously_failed_equiv
 	   ? (-$max_variation_bonus+$variation_bonus) : -$variation_bonus)
Signature · 1 line
1.7.10.4
#14 lore raw
In reply to Ian Jackson
Quoted 2 lines · Ian Jackson

Here, I'm trying to fix the way that osstest gets far too obsessed about particular failing hosts.

All fine by me, not that I've really grokked the bits towards the end. (I will try to if you want)

Quoted 11 lines

1/9 cs-adjust-flight: Fix doc about /<pcre> to match 2/9 ts-hosts-allocate-Executive: allow uncompressed 3/9 Osstest/Executive.pm: Debug log same-host status 4/9 ts-hosts-allocate-Executive: Move $variation_age 5/9 ts-hosts-allocate-Executive: Do not prefer fast 6/9 ts-hosts-allocate-Executive: Clarify an 7/9 ts-hosts-allocate-Executive: Score for 8/9 ts-hosts-allocate-Executive: Redo
9/9 ts-hosts-allocate-Executive: Radically reduce

#15 lore raw

Ian Campbell writes ("Re: [OSSTEST PATCH 0/9] Host allocation scoring improvements"):

Quoted 6 lines · Ian Jackson
Quoted 2 lines

Here, I'm trying to fix the way that osstest gets far too obsessed about particular failing hosts.

All fine by me, not that I've really grokked the bits towards the end. (I will try to if you want)

I find this area a bit confusing, and it's a right bastard to test, so if you have the bandwidth for a proper review that would be great.

Thanks,
Ian.

Acked-by
#16 lore raw
Quoted 10 lines · Ian Jackson

Ian Campbell writes ("Re: [OSSTEST PATCH 0/9] Host allocation scoring improvements"):

Quoted 6 lines · Ian Jackson
Quoted 2 lines

Here, I'm trying to fix the way that osstest gets far too obsessed about particular failing hosts.

All fine by me, not that I've really grokked the bits towards the end. (I will try to if you want)

I find this area a bit confusing, and it's a right bastard to test, so if you have the bandwidth for a proper review that would be great.

These:
[OSSTEST PATCH 1/9] cs-adjust-flight: Fix doc about /<pcre> to match implementation [OSSTEST PATCH 2/9] ts-hosts-allocate-Executive: allow uncompressed log [OSSTEST PATCH 3/9] Osstest/Executive.pm: Debug log same-host status (in duration estimator) [OSSTEST PATCH 4/9] ts-hosts-allocate-Executive: Move $variation_age setting [OSSTEST PATCH 5/9] ts-hosts-allocate-Executive: Do not prefer fast hosts for tests [OSSTEST PATCH 6/9] ts-hosts-allocate-Executive: Clarify an expression with //

Are:

I'll try and grok the rest now and reply to them individually.

Ian.