forked from lix-project/hydra
When propagating failure, propagate the duration and machine
Previously the duration would just show as "0" and you would have to search for the original build to get the duration.
This commit is contained in:
parent
2f946bdfd7
commit
48af914e28
|
@ -39,7 +39,7 @@ sub nextFreeStepNr {
|
||||||
|
|
||||||
|
|
||||||
sub failDependents {
|
sub failDependents {
|
||||||
my ($drvPath, $status, $errorMsg, $dependents) = @_;
|
my ($drvPath, $status, $errorMsg, $dependents, $startTime, $stopTime, $machine) = @_;
|
||||||
|
|
||||||
# Get the referrer closure of $drvPath.
|
# Get the referrer closure of $drvPath.
|
||||||
my $dependentDrvs = Set::Scalar->new(computeFSClosure(1, 0, $drvPath));
|
my $dependentDrvs = Set::Scalar->new(computeFSClosure(1, 0, $drvPath));
|
||||||
|
@ -71,9 +71,10 @@ sub failDependents {
|
||||||
, drvpath => $drvPath
|
, drvpath => $drvPath
|
||||||
, busy => 0
|
, busy => 0
|
||||||
, status => $status
|
, status => $status
|
||||||
, starttime => $time
|
, starttime => $startTime
|
||||||
, stoptime => $time
|
, stoptime => $stopTime
|
||||||
, errormsg => $errorMsg
|
, errormsg => $errorMsg
|
||||||
|
, machine => $machine
|
||||||
});
|
});
|
||||||
addBuildStepOutputs($step);
|
addBuildStepOutputs($step);
|
||||||
|
|
||||||
|
@ -204,10 +205,17 @@ sub doBuild {
|
||||||
} else {
|
} else {
|
||||||
$errorMsg = $4;
|
$errorMsg = $4;
|
||||||
}
|
}
|
||||||
|
my $now = time;
|
||||||
|
my $stepStartTime = $now;
|
||||||
|
my $stepStopTime = $now;
|
||||||
|
my $machine = undef;
|
||||||
txn_do($db, sub {
|
txn_do($db, sub {
|
||||||
if ($buildSteps{$drvPathStep}) {
|
if ($buildSteps{$drvPathStep}) {
|
||||||
my $step = $build->buildsteps->find({stepnr => $buildSteps{$drvPathStep}}) or die;
|
my $step = $build->buildsteps->find({stepnr => $buildSteps{$drvPathStep}}) or die;
|
||||||
$step->update({busy => 0, status => $status, errormsg => $errorMsg, stoptime => time});
|
$stepStartTime = $step->starttime;
|
||||||
|
$stepStopTime = $now;
|
||||||
|
$machine = $step->machine;
|
||||||
|
$step->update({busy => 0, status => $status, errormsg => $errorMsg, stoptime => $now});
|
||||||
}
|
}
|
||||||
# Don't write a record if this derivation already
|
# Don't write a record if this derivation already
|
||||||
# failed previously. This can happen if this is a
|
# failed previously. This can happen if this is a
|
||||||
|
@ -219,8 +227,8 @@ sub doBuild {
|
||||||
, drvpath => $drvPathStep
|
, drvpath => $drvPathStep
|
||||||
, busy => 0
|
, busy => 0
|
||||||
, status => $status
|
, status => $status
|
||||||
, starttime => time
|
, starttime => $now
|
||||||
, stoptime => time
|
, stoptime => $now
|
||||||
, errormsg => $errorMsg
|
, errormsg => $errorMsg
|
||||||
});
|
});
|
||||||
addBuildStepOutputs($step);
|
addBuildStepOutputs($step);
|
||||||
|
@ -228,7 +236,7 @@ sub doBuild {
|
||||||
});
|
});
|
||||||
|
|
||||||
# Immediately fail all builds that depend on this derivation.
|
# Immediately fail all builds that depend on this derivation.
|
||||||
failDependents($drvPathStep, $status, $errorMsg, $dependents);
|
failDependents($drvPathStep, $status, $errorMsg, $dependents, $stepStartTime, $stepStopTime, $machine);
|
||||||
}
|
}
|
||||||
|
|
||||||
elsif (/^@\s+substituter-started\s+(\S+)\s+(\S+)$/) {
|
elsif (/^@\s+substituter-started\s+(\S+)\s+(\S+)$/) {
|
||||||
|
|
Loading…
Reference in a new issue