From: Ian Jackson <ian.jack...@eu.citrix.com>

Signed-off-by: Ian Jackson <ian.jack...@eu.citrix.com>
---
 ts-hosts-allocate-Executive | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/ts-hosts-allocate-Executive b/ts-hosts-allocate-Executive
index a50f8bf3..c1002fc9 100755
--- a/ts-hosts-allocate-Executive
+++ b/ts-hosts-allocate-Executive
@@ -733,8 +733,13 @@ sub alloc_hosts () {
         ? -10000
         : -10 * @hids;
 
-    my $infrapriority =
-       ($r{hosts_infraprioritygroup} // '') =~ m/^(\d+):/ ? $1 : undef;
+    my $infrapriority;
+    if (($r{hosts_infraprioritygroup} // '') =~ m/^(\d+):/) {
+       $infrapriority = ($1 * 100) + ($$ % 100);
+       # $$ provides a pseudorandom element, which arranges that jobs
+       # in a group roughly take turns to take the scheduling lead,
+       # which will hopefully help them converge.
+    }
 
     my $ok = alloc_resources(WaitStart =>
                     ($ENV{OSSTEST_RESOURCE_WAITSTART} || $fi->{started}),
-- 
2.20.1


Reply via email to