From 737423a89c4b5f666fb4daf61775764b66911cf1 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 29 Mar 2009 18:00:45 +0000 Subject: * Use polling to wait for a remote build slot when using a build hook (that is, call the build hook with a certain interval until it accepts the build). * build-remote.pl was totally broken: for all system types other than the local system type, it would send all builds to the *first* machine of the appropriate type. --- scripts/build-remote.pl.in | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'scripts/build-remote.pl.in') diff --git a/scripts/build-remote.pl.in b/scripts/build-remote.pl.in index ef8d3bbea..03bceb884 100755 --- a/scripts/build-remote.pl.in +++ b/scripts/build-remote.pl.in @@ -23,8 +23,7 @@ use English '-no_match_vars'; my $loadIncreased = 0; -my ($amWilling, $localSystem, $neededSystem, $drvPath, $mustRun, $maxSilentTime) = @ARGV; -$mustRun = 0 unless defined $mustRun; +my ($amWilling, $localSystem, $neededSystem, $drvPath, $maxSilentTime) = @ARGV; $maxSilentTime = 0 unless defined $maxSilentTime; sub sendReply { @@ -87,12 +86,10 @@ LOOP: foreach my $cur (@machines) { # We have a machine of the right type. Try to get a lock on # one of the machine's lock files. my $slot = 0; - while ($slot < $cur->{maxJobs} || ($mustRun && !$canBuildLocally)) { + while ($slot < $cur->{maxJobs}) { my $slotLock = "$currentLoad/" . $cur->{systemType} . "-" . $cur->{hostName} . "-$slot"; open SLOTLOCK, ">>$slotLock" or die; if (flock(SLOTLOCK, LOCK_EX | LOCK_NB)) { - print STDERR "warning: exceeding maximum load on " . $cur->{systemType} . "\n" - if $slot >= $cur->{maxJobs}; $machine = $cur; last LOOP; } -- cgit v1.2.3