Set propagatedFrom for cached failed build steps

[?]
Sep 11, 2015, 1:55 PM
BCDHO4OULIMAC2RNZM5LKDOD2CYENXU6JGEHQZEXZBUMXK3QC3AAC

Dependencies

  • [2] 4CQWOODY Don't abort steps that have an unsupported system type
  • [3] MHVIT4JY Split hydra-queue-runner.cc more

Change contents

  • replacement in src/hydra-queue-runner/queue-monitor.cc at line 172
    [3.26572][2.142:212]()
    createBuildStep(txn, 0, build, r, "", bssFailed);
    [3.26572]
    [3.26648]
    /* Find the previous build step record, first by
    derivation path, then by output path. */
    BuildID propagatedFrom = 0;
    auto res = txn.parameterized
    ("select max(build) from BuildSteps where drvPath = $1 and startTime != 0 and stopTime != 0 and status = 1")
    (r->drvPath).exec();
    if (!res[0][0].is_null()) propagatedFrom = res[0][0].as<BuildID>();
    if (!propagatedFrom) {
    for (auto & output : r->drv.outputs) {
    auto res = txn.parameterized
    ("select max(s.build) from BuildSteps s join BuildStepOutputs o on s.build = o.build where path = $1 and startTime != 0 and stopTime != 0 and status = 1")
    (output.second.path).exec();
    if (!res[0][0].is_null()) {
    propagatedFrom = res[0][0].as<BuildID>();
    break;
    }
    }
    }
    createBuildStep(txn, 0, build, r, "", bssCachedFailure, "", propagatedFrom);