Fail builds with previously failed steps early

[?]
Jun 15, 2015, 1:31 PM
IWB3F4Z6QZYHQFJ6FWZTGWLCPBYEUTFLUS3F7QT7JOA4DV4YLYGAC

Dependencies

  • [2] UQQ4IL55 Add a error type for "unsupported system type"
  • [3] 22LDPAIP Check non-runnable steps for unsupported system type
  • [4] RYTQLATY Keep track of failed paths in the Hydra database
  • [5] 5AIYUMTB Basic remote building
  • [6] FQQRJUO4 Mark builds as busy
  • [7] YZAI5GQU Implement a database connection pool
  • [8] KBZHIGLG Record the machine used for a build step
  • [9] 24BMQDZA Start of single-process hydra-queue-runner
  • [10] N5O7VEEO Immediately abort builds that require an unsupported system type
  • [*] NJJ7H64S Very basic multi-threaded queue runner

Change contents

  • edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 250
    [4.7481]
    [12.1377]
    bool checkCachedFailure(Step::ptr step, Connection & conn);
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 497
    [4.306][4.306:430]()
    /* If any step has an unsupported system type, then fail the
    build. */
    bool allSupported = true;
    [4.306]
    [3.212]
    /* If any step has an unsupported system type or has a
    previously failed output path, then fail the build right
    away. */
    bool badStep = false;
  • edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 502
    [3.248]
    [4.469]
    BuildStatus buildStatus = bsSuccess;
    BuildStepStatus buildStepStatus;
  • edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 511
    [4.726]
    [2.76]
  • edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 513
    [2.106][2.106:144]()
    allSupported = false;
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 514
    [2.234][2.234:272]()
    pqxx::work txn(conn);
    [2.234]
    [2.272]
    buildStatus = bsUnsupported;
    buildStepStatus = bssUnsupported;
    }
    if (checkCachedFailure(r, conn)) {
    printMsg(lvlError, format("failing build %1% due to previous failure") % build->id);
    buildStatus = step == r ? bsFailed : bsFailed;
    buildStepStatus = bssFailed;
    }
    if (buildStatus != bsSuccess) {
  • edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 526
    [2.310]
    [2.310]
    pqxx::work txn(conn);
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 528
    [2.344][2.344:472]()
    ("update Builds set finished = 1, busy = 0, buildStatus = $2, startTime = $3, stopTime = $3 where id = $1")
    [2.344]
    [2.472]
    ("update Builds set finished = 1, busy = 0, buildStatus = $2, startTime = $3, stopTime = $3, isCachedBuild = $4 where id = $1")
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 530
    [2.504][2.504:653]()
    ((int) bsUnsupported)
    (now).exec();
    createBuildStep(txn, now, build, r, "", bssUnsupported);
    [2.504]
    [2.653]
    ((int) buildStatus)
    (now)
    (buildStatus != bsUnsupported ? 1 : 0).exec();
    createBuildStep(txn, now, build, r, "", buildStepStatus);
  • edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 535
    [2.683]
    [2.683]
    badStep = true;
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 540
    [4.11403][2.721:758]()
    if (!allSupported) continue;
    [4.11403]
    [4.11435]
    if (badStep) continue;
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 903
    [4.224][4.224:256](),[4.256][4.15566:15572](),[4.15566][4.15566:15572](),[4.15572][4.708:739](),[4.739][4.257:487](),[4.487][4.15696:15702](),[4.15696][4.15696:15702]()
    bool cachedFailure = false;
    {
    pqxx::work txn(*conn);
    for (auto & path : outputPaths(step->drv))
    if (!txn.parameterized("select 1 from FailedPaths where path = $1")(path).exec().empty()) {
    cachedFailure = true;
    break;
    }
    }
    [4.224]
    [4.15702]
    bool cachedFailure = checkCachedFailure(step, *conn);
  • edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 1062
    [4.19072]
    [12.3176]
    }
    bool State::checkCachedFailure(Step::ptr step, Connection & conn)
    {
    pqxx::work txn(conn);
    for (auto & path : outputPaths(step->drv))
    if (!txn.parameterized("select 1 from FailedPaths where path = $1")(path).exec().empty())
    return true;
    return false;