When manually scheduling an eval, force re-instantiation of store derivations

Without this, if (failed or aborted) derivations have been
garbage-collected, there is no way to restart them, which is very
annoying. Now we set a forceEval flag in the jobset to cause it to be
re-evaluated even if none of the inputs have changed.
This commit is contained in:
Eelco Dolstra
2016-10-24 20:20:20 +02:00
parent 140cbe9302
commit a12e9478e7
5 changed files with 18 additions and 8 deletions

View File

@ -149,7 +149,7 @@ sub checkJobsetWrapped {
my @args = ($jobset->nixexprinput, $jobset->nixexprpath, inputsToArgs($inputInfo, $exprType));
my $argsHash = sha256_hex("@args");
my $prevEval = getPrevJobsetEval($db, $jobset, 0);
if (defined $prevEval && $prevEval->hash eq $argsHash && !$dryRun) {
if (defined $prevEval && $prevEval->hash eq $argsHash && !$dryRun && !$jobset->forceeval) {
print STDERR " jobset is unchanged, skipping\n";
Net::Statsd::increment("hydra.evaluator.unchanged_checkouts");
txn_do($db, sub {
@ -279,7 +279,7 @@ sub checkJobsetWrapped {
# If this is a one-shot jobset, disable it now.
$jobset->update({ enabled => 0 }) if $jobset->enabled == 2;
$jobset->update({ lastcheckedtime => time });
$jobset->update({ lastcheckedtime => time, forceeval => undef });
});
my $dbStop = clock_gettime(CLOCK_REALTIME);