Skip to contentSkip to conversation

ts-hosts-allocate-Executive: Move $prevfail_bonus initial setting

PATCH In review Ian Jackson 2 participants 3 messages May 25, 2017 – May 26, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ts-hosts-allocate-Executive: Move $prevfail_bonus initial setting

No functional change. This is going to make the next patch easy.

---
 ts-hosts-allocate-Executive | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
ts-hosts-allocate-Executive +3 -1
index 9955cba..7494291 100755
@@ -618,6 +618,8 @@ sub hid_recurse ($$) {
 
     $duration_rightaway_adjust=0 if $start_time;
 
+    my $prevfail_bonus = $r{hostalloc_bonus_previousfail}
+
     my $duration_for_cost = 0;
     if ($jobinfo->{recipe} =~ m/build/) {
         $variation_age= 0;
@@ -630,7 +632,7 @@ sub hid_recurse ($$) {
     $variation_bonus=$max_variation_bonus
 	if $variation_bonus>$max_variation_bonus;
 
-    my $prevfail_bonus = $r{hostalloc_bonus_previousfail} // 7.0*86400;
+    $prevfail_bonus //= 7.0*86400;
     my $prevfail_equiv_bonus = $prevfail_bonus * (6.5 / 7.0);
 
     my $share_reuse_bonus = $r{hostalloc_bonus_sharereuse} // 10000;
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#1 lore raw

PATCH 2/2 ts-hosts-allocate-Executive: Make build failures not be host-sticky

Builds (jobs whose recipe contains `build') are not supposed to contain host-specific tests. We already don't care about varying which host they run on, to hunt for host-specific bugs.

We should also not make build failures sticky to the host they last failed on.

Fix this by defaulting $prevfail_bonus to 0 in that case, before the week-long later default is applied. This means that a build job runvar would override the built-in default whether that's 7 days or 0.

---
 ts-hosts-allocate-Executive | 1 +
 1 file changed, 1 insertion(+)
ts-hosts-allocate-Executive +1 -0
index 7494291..975a8b9 100755
@@ -624,6 +624,7 @@ sub hid_recurse ($$) {
     if ($jobinfo->{recipe} =~ m/build/) {
         $variation_age= 0;
 	$duration_for_cost= $duration + $duration_rightaway_adjust;
+	$prevfail_bonus //= 0;
     }
 
     my $log_variation_age = log(1+$variation_age/86400);
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Tested-by on v1 1/2
#2 lore raw
In reply to Ian Jackson
Quoted 13 lines · Ian Jackson

No functional change. This is going to make the next patch easy.

---
 ts-hosts-allocate-Executive | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
ts-hosts-allocate-Executive +0 -0
index 9955cba..7494291 100755

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

Quoted 4 lines
ts-hosts-allocate-Executive +1 -0
@@ -618,6 +618,8 @@ sub hid_recurse ($$) {
 
     $duration_rightaway_adjust=0 if $start_time;
 
+    my $prevfail_bonus = $r{hostalloc_bonus_previousfail}
                                                            ^;

Apart from that, you can add my:

To both patches.

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel