From 4705af48b8846e14329f22b89aef27361d9b4467 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 18 Sep 2013 13:06:35 +0000 Subject: [PATCH] hydra-build: Hack to handle timeouts --- src/script/hydra-build | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/script/hydra-build b/src/script/hydra-build index 557090cc..b7d52422 100755 --- a/src/script/hydra-build +++ b/src/script/hydra-build @@ -142,6 +142,22 @@ sub doBuild { next; } + # Hack to handle timeouts, which Nix doesn't report + # properly when they occur remotely. If we get a "hook + # failed" error and $maxsilent seconds have passed since + # the start of the build step, then assume that a timeout + # occured. + if (/^@\s+hook-failed\s+(\S+)\s+(\S+)\s+(\S+)\s+(.*)$/ && $3 eq "256") { + my $drvPathStep = $1; + if ($buildSteps{$drvPathStep}) { + my $step = $build->buildsteps->find({stepnr => $buildSteps{$drvPathStep}}) or die; + print STDERR $step->starttime, " ", time(), "\n"; + if ($step->starttime + $maxsilent <= time) { + $_ = "@ build-failed $1 $2 timeout $4"; + } + } + } + if (/^@\s+build-started\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)$/) { my $drvPathStep = $1; txn_do($db, sub {