forked from lix-project/hydra
Handle active build steps of aborted builds properly
This commit is contained in:
parent
30e5185acf
commit
ecdbce1a61
|
@ -41,13 +41,11 @@
|
||||||
<td>[% step.machine.split('@').1 %]</td>
|
<td>[% step.machine.split('@').1 %]</td>
|
||||||
<td>
|
<td>
|
||||||
[% IF step.busy == 1 %]
|
[% IF step.busy == 1 %]
|
||||||
[% IF build.finished %]
|
|
||||||
<span class="error">Aborted</span>
|
|
||||||
[% ELSE %]
|
|
||||||
<strong>Building</strong>
|
<strong>Building</strong>
|
||||||
[% END %]
|
|
||||||
[% ELSIF step.status == 0 %]
|
[% ELSIF step.status == 0 %]
|
||||||
Succeeded
|
Succeeded
|
||||||
|
[% ELSIF step.status == 4 %]
|
||||||
|
<span class="error">Aborted</span>
|
||||||
[% ELSE %]
|
[% ELSE %]
|
||||||
<span class="error">Failed: [% HTML.escape(step.errormsg) %]</span>
|
<span class="error">Failed: [% HTML.escape(step.errormsg) %]</span>
|
||||||
[% END %]
|
[% END %]
|
||||||
|
@ -163,7 +161,7 @@
|
||||||
|
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
||||||
[% IF !build.finished %]
|
[% IF build.busy %]
|
||||||
<h3>Running build steps</h3>
|
<h3>Running build steps</h3>
|
||||||
[% INCLUDE renderBuildSteps type="Running" %]
|
[% INCLUDE renderBuildSteps type="Running" %]
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
|
@ -286,10 +286,7 @@ sub doBuild {
|
||||||
my $drvPathStep = $1;
|
my $drvPathStep = $1;
|
||||||
txn_do($db, sub {
|
txn_do($db, sub {
|
||||||
my $step = $build->buildsteps->find({stepnr => $buildSteps{$drvPathStep}}) or die;
|
my $step = $build->buildsteps->find({stepnr => $buildSteps{$drvPathStep}}) or die;
|
||||||
my $stepOutpath = $step->outpath;
|
$step->update({busy => 0, status => 0, stoptime => time});
|
||||||
my $stepStatus = 0;
|
|
||||||
|
|
||||||
$step->update({busy => 0, status => $stepStatus, stoptime => time});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@ sub unlockDeadBuilds {
|
||||||
if ($unlock) {
|
if ($unlock) {
|
||||||
print "build ", $build->id, " pid $pid died, unlocking\n";
|
print "build ", $build->id, " pid $pid died, unlocking\n";
|
||||||
$build->update({ busy => 0, locker => ""});
|
$build->update({ busy => 0, locker => ""});
|
||||||
|
$build->buildsteps->search({ busy => 1 })->update({ busy => 0, status => 4, stoptime => time });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue