diff mbox series

[OSSTEST,3/7] ts-hosts-allocate-Executive: Do a pre-check

Message ID 20200819160143.11178-4-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show
Series host allocation: Performance improvements | expand

Commit Message

Ian Jackson Aug. 19, 2020, 4:01 p.m. UTC
Call attempt_allocation with an empty plan and $mayalloc=0.

In the usual case this will arrange to prime our memoisation caches
before we get involved with the queueing system.

It will also arrange for various errors to be reported sooner.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 ts-hosts-allocate-Executive | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/ts-hosts-allocate-Executive b/ts-hosts-allocate-Executive
index e5a6fbfe..4140b65c 100755
--- a/ts-hosts-allocate-Executive
+++ b/ts-hosts-allocate-Executive
@@ -692,6 +692,13 @@  sub alloc_hosts () {
         return;
     }
 
+    {
+	logm("pre-checking resources...");
+	local $Osstest::TestSupport::logm_prefix = $logm_prefix.' (precheck)';
+	my ($ok, $bookinglist) = attempt_allocation({}, 0);
+	die $ok if $ok>1 && $ok != $alloc_starved_r;
+    }
+
     my $waitstartadjust=
         $jobinfo->{recipe} =~ m/build/
         ? -10000