Revert "build-remote.pl: Enforce timeouts locally"

This reverts commit 69b8f9980f.

The timeout should be enforced remotely.  Otherwise, if the garbage
collector is running either locally or remotely, if will block the
build or closure copying for some time.  If the garbage collector
takes too long, the build may time out, which is not what we want.
Also, on heavily loaded systems, copying large paths to and from the
remote machine can take a long time, also potentially resulting in a
timeout.
This commit is contained in:
Eelco Dolstra 2013-07-18 12:52:16 +02:00
parent 16591eb3cc
commit a4921b8ceb
2 changed files with 6 additions and 3 deletions

View file

@ -46,7 +46,7 @@ sub all { $_ || return 0 for @_; 1 }
# Initialisation. # Initialisation.
my $loadIncreased = 0; my $loadIncreased = 0;
my ($localSystem, $printBuildTrace) = @ARGV; my ($localSystem, $maxSilentTime, $printBuildTrace, $buildTimeout) = @ARGV;
my $currentLoad = $ENV{"NIX_CURRENT_LOAD"}; my $currentLoad = $ENV{"NIX_CURRENT_LOAD"};
my $conf = $ENV{"NIX_REMOTE_SYSTEMS"}; my $conf = $ENV{"NIX_REMOTE_SYSTEMS"};
@ -261,7 +261,8 @@ close UPLOADLOCK;
# Perform the build. # Perform the build.
my $buildFlags = my $buildFlags =
" --fallback --add-root $rootsDir/\$PPID.out --quiet" "--max-silent-time $maxSilentTime --option build-timeout $buildTimeout"
. " --fallback --add-root $rootsDir/\$PPID.out --quiet"
. " --option build-keep-log false"; . " --option build-keep-log false";
# We let the remote side kill its process group when the connection is # We let the remote side kill its process group when the connection is

View file

@ -695,7 +695,9 @@ HookInstance::HookInstance()
throw SysError("dupping builder's stdout/stderr"); throw SysError("dupping builder's stdout/stderr");
execl(buildHook.c_str(), buildHook.c_str(), settings.thisSystem.c_str(), execl(buildHook.c_str(), buildHook.c_str(), settings.thisSystem.c_str(),
(format("%1%") % settings.maxSilentTime).str().c_str(),
(format("%1%") % settings.printBuildTrace).str().c_str(), (format("%1%") % settings.printBuildTrace).str().c_str(),
(format("%1%") % settings.buildTimeout).str().c_str(),
NULL); NULL);
throw SysError(format("executing `%1%'") % buildHook); throw SysError(format("executing `%1%'") % buildHook);
@ -1679,7 +1681,7 @@ HookReply DerivationGoal::tryBuildHook()
set<int> fds; set<int> fds;
fds.insert(hook->fromHook.readSide); fds.insert(hook->fromHook.readSide);
fds.insert(hook->builderOut.readSide); fds.insert(hook->builderOut.readSide);
worker.childStarted(shared_from_this(), hook->pid, fds, false, true); worker.childStarted(shared_from_this(), hook->pid, fds, false, false);
if (settings.printBuildTrace) if (settings.printBuildTrace)
printMsg(lvlError, format("@ build-started %1% - %2% %3%") printMsg(lvlError, format("@ build-started %1% - %2% %3%")