Update libpqxx usage to move away from deprecated API interactions.

[?]
Jan 12, 2020, 6:38 AM
DKR2GXSAVIZGOR3HEAD46SZWTRXJO2EH43H57P2365Y5M2QCQHDAC

Dependencies

  • [2] X2LETBPI Fix race in finishing builds that have been cancelled
  • [3] UPNGFCXG For completeness, re-implement meta.schedulingPriority
  • [4] YFD6CBV3 hydra-queue-runner: Fix handling of missing derivations
  • [5] 2H2AVMXI Fix "Evaluation pending since..." message even though the jobset has been evaluated
  • [6] PW4TLMWS Sync with latest Nix
  • [7] XIFDDTXZ Don't lock the BuildSteps table when inserting
  • [8] G7KWXSFM Distinguish build step states
  • [9] WYELTQMO Separate payload elements using \t
  • [10] 7LWB2J2Z Periodically clear orphaned build steps
  • [11] 62MQPRXC Pass null values to libpqxx properly
  • [12] IWB3F4Z6 Fail builds with previously failed steps early
  • [13] LJILHOJ7 Create BuildSteps race-free
  • [14] UQQ4IL55 Add a error type for "unsupported system type"
  • [15] UNVMKJV5 Unify build and step status codes
  • [16] WDGARQ76 Reuse build products / metrics stored in the database
  • [17] PLOZBRTR Add command ‘hydra-queue-runner --status’ to show current status
  • [18] IE2PRAQU hydra-queue-runner: Send build notifications
  • [19] W4G5MZZS hydra-evaluator improvements
  • [20] BRAESISH Warn if PostgreSQL appears stalled
  • [21] NJJ7H64S Very basic multi-threaded queue runner
  • [22] RQUAATWB Add status dump facility
  • [23] VZCNKQSB Remove superfluous check
  • [24] FITVNQ2S Keep track of the time we spend copying to/from build machines
  • [25] 3BKPZ52C Disambiguate "marking build as succeeded" message
  • [26] ACBS7C6Q hydra-queue-runner: Detect changes to the scheduling shares
  • [27] HPJKBFZ4 Handle concurrent finishing of the same build
  • [28] 24BMQDZA Start of single-process hydra-queue-runner
  • [29] BG6PEOB2 Make the output size limit configurable
  • [30] LVQXQIYA Kill active build steps when builds are cancelled
  • [31] PQFOMNTL hydra-queue-runner: More stats
  • [32] 5AIYUMTB Basic remote building
  • [33] IK2UBDAU Revive jobset scheduling
  • [34] VQISTKOP hydra-queue-runner: Use substitutes
  • [35] DKJFD6JN Process Nix API changes
  • [36] WE5Q2NVI Allow build to be bumped to the front of the queue via the web interface
  • [37] 32KJOERM Turn hydra-notify into a daemon
  • [38] L2IBPED2 Typo
  • [39] MSIHMO45 Tweak build steps
  • [40] P6EWEJHL hydra-evaluator: Allow setting the maximum number of concurrent evaluations
  • [41] 4YCF3KBG Concurrent hydra-evaluator
  • [42] FQQRJUO4 Mark builds as busy
  • [43] WHULPA6S Handle failure with output
  • [44] B7ENVLRS hydra-queue-runner: Make build notification more reliable
  • [45] GKZN4UV7 Make the queue monitor more robust, and better debug output
  • [46] HUUZFPPK Fix race between the queue monitor and the builder threads
  • [47] TPNHTE5V Remove obsolete Builds columns and provide accurate "Running builds"
  • [48] YZAI5GQU Implement a database connection pool
  • [49] NAYQT2GT hydra-queue-runner: Use cmdBuildDerivation
  • [50] KBZHIGLG Record the machine used for a build step
  • [51] LENA4O2V Periodically close RemoteStore connections
  • [52] T5BIOVJE Add support for tracking custom metrics
  • [53] RND7XFNH getQueuedBuilds(): Periodically stop to handle priority bumps
  • [54] MHVIT4JY Split hydra-queue-runner.cc more
  • [55] YTAYNN7V Queue monitor: Bail out earlier if a step has failed previously
  • [56] ZK76B5ZZ Load the queue in order of global priority
  • [57] ZM6WYVL7 hydra-evaluator: Set jobset error if hydra-eval-jobset dies
  • [58] NTEDD7T4 Provide a plugin hook for when build steps finish
  • [59] EPWEMRI2 Allow determinism checking for entire jobsets

Change contents

  • replacement in src/hydra-evaluator/hydra-evaluator.cc at line 62
    [10.1490][10.1490:1527]()
    auto res = txn.parameterized
    [10.1490]
    [10.1527]
    auto res = txn.exec
  • replacement in src/hydra-evaluator/hydra-evaluator.cc at line 64
    [10.1664][10.1664:1728]()
    "where j.enabled != 0 and p.enabled != 0").exec();
    [10.1664]
    [10.1728]
    "where j.enabled != 0 and p.enabled != 0");
  • replacement in src/hydra-evaluator/hydra-evaluator.cc at line 110
    [10.715][10.715:952]()
    txn.parameterized
    ("update Jobsets set startTime = $1 where project = $2 and name = $3")
    (now)
    (jobset.name.first)
    (jobset.name.second)
    .exec();
    [10.715]
    [10.952]
    txn.exec_params0
    ("update Jobsets set startTime = $1 where project = $2 and name = $3",
    now,
    jobset.name.first,
    jobset.name.second);
  • replacement in src/hydra-evaluator/hydra-evaluator.cc at line 268
    [10.1993][10.1993:2039](),[10.2039][5.0:162](),[5.162][10.2200:2346](),[10.2200][10.2200:2346]()
    txn.parameterized
    ("update Jobsets set triggerTime = null where project = $1 and name = $2 and startTime is not null and triggerTime <= startTime")
    (jobset.name.first)
    (jobset.name.second)
    .exec();
    [10.1993]
    [10.2346]
    txn.exec_params0
    ("update Jobsets set triggerTime = null where project = $1 and name = $2 and startTime is not null and triggerTime <= startTime",
    jobset.name.first,
    jobset.name.second);
  • replacement in src/hydra-evaluator/hydra-evaluator.cc at line 274
    [10.2403][10.2403:2700]()
    txn.parameterized
    ("update Jobsets set startTime = null where project = $1 and name = $2")
    (jobset.name.first)
    (jobset.name.second)
    .exec();
    [10.2403]
    [10.31]
    txn.exec_params0
    ("update Jobsets set startTime = null where project = $1 and name = $2",
    jobset.name.first,
    jobset.name.second);
  • replacement in src/hydra-evaluator/hydra-evaluator.cc at line 280
    [10.225][10.225:275](),[10.275][10.2701:2867](),[10.2867][10.364:447](),[10.364][10.364:447](),[10.447][10.2868:3023](),[10.3023][10.493:538](),[10.493][10.493:538]()
    txn.parameterized
    ("update Jobsets set errorMsg = $1, lastCheckedTime = $2, errorTime = $2, fetchErrorMsg = null where project = $3 and name = $4")
    (fmt("evaluation %s", statusToString(status)))
    (now)
    (jobset.name.first)
    (jobset.name.second)
    .exec();
    [10.113]
    [10.584]
    txn.exec_params0
    ("update Jobsets set errorMsg = $1, lastCheckedTime = $2, errorTime = $2, fetchErrorMsg = null where project = $3 and name = $4",
    fmt("evaluation %s", statusToString(status)),
    now,
    jobset.name.first,
    jobset.name.second);
  • replacement in src/hydra-evaluator/hydra-evaluator.cc at line 310
    [10.3277][10.3277:3350]()
    txn.parameterized("update Jobsets set startTime = null").exec();
    [10.3277]
    [10.3350]
    txn.exec("update Jobsets set startTime = null");
  • replacement in src/hydra-queue-runner/builder.cc at line 427
    [10.12489][10.12489:12527](),[10.12527][10.0:190](),[10.184][10.12696:12733](),[10.190][10.12696:12733](),[10.12696][10.12696:12733](),[10.12733][10.3520:3660](),[10.3660][10.12855:12940](),[10.12855][10.12855:12940](),[10.12940][10.3661:3740]()
    txn.parameterized
    ("update Builds set finished = 1, buildStatus = $2, startTime = $3, stopTime = $4, isCachedBuild = $5, notificationPendingSince = $4 where id = $1 and finished = 0")
    (build2->id)
    ((int) (build2->drvPath != step->drvPath && result.buildStatus() == bsFailed ? bsDepFailed : result.buildStatus()))
    (result.startTime)
    (result.stopTime)
    (result.stepStatus == bsCachedFailure ? 1 : 0).exec();
    [10.12489]
    [10.12996]
    txn.exec_params0
    ("update Builds set finished = 1, buildStatus = $2, startTime = $3, stopTime = $4, isCachedBuild = $5, notificationPendingSince = $4 where id = $1 and finished = 0",
    build2->id,
    (int) (build2->drvPath != step->drvPath && result.buildStatus() == bsFailed ? bsDepFailed : result.buildStatus()),
    result.startTime,
    result.stopTime,
    result.stepStatus == bsCachedFailure ? 1 : 0);
  • replacement in src/hydra-queue-runner/builder.cc at line 441
    [10.759][10.13314:13409](),[10.13314][10.13314:13409]()
    txn.parameterized("insert into FailedPaths values ($1)")(path).exec();
    [10.759]
    [10.13409]
    txn.exec_params0("insert into FailedPaths values ($1)", path);
  • edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 3
    [10.286]
    [10.286]
    #include <optional>
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 230
    [10.268][10.0:22](),[10.447][10.0:22](),[10.7845][10.0:22](),[10.22][8.813:900](),[8.900][10.425:451](),[10.7964][10.425:451](),[10.451][10.50:92](),[10.50][10.50:92]()
    txn.parameterized
    ("update BuildSteps set busy = 0, status = $1, stopTime = $2 where busy != 0")
    ((int) bsAborted)
    (stopTime, stopTime != 0).exec();
    [10.268]
    [10.8053]
    txn.exec_params0
    ("update BuildSteps set busy = 0, status = $1, stopTime = $2 where busy != 0",
    (int) bsAborted,
    stopTime != 0 ? std::make_optional(stopTime) : std::nullopt);
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 240
    [10.198][10.2702:2807](),[10.2807][10.63:125](),[10.8363][10.63:125]()
    auto res = txn.parameterized("select max(stepnr) from BuildSteps where build = $1")(buildId).exec();
    return res[0][0].is_null() ? 1 : res[0][0].as<int>() + 1;
    [10.8256]
    [10.125]
    auto res = txn.exec_params1("select max(stepnr) from BuildSteps where build = $1", buildId);
    return res[0].is_null() ? 1 : res[0].as<int>() + 1;
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 251
    [10.8432][7.11:268](),[7.268][10.2963:2981](),[10.578][10.2963:2981](),[10.2981][10.405:470](),[10.405][10.405:470](),[10.470][10.560:595](),[10.506][10.73:138](),[10.595][10.73:138](),[10.73][10.73:138](),[10.138][10.596:637](),[10.637][10.262:343](),[10.262][10.262:343](),[10.343][10.638:694](),[10.196][10.49:75](),[10.694][10.49:75](),[10.618][10.49:75]()
    auto r = txn.parameterized
    ("insert into BuildSteps (build, stepnr, type, drvPath, busy, startTime, system, status, propagatedFrom, errorMsg, stopTime, machine) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12) on conflict do nothing")
    (buildId)
    (stepNr)
    (0) // == build
    (step->drvPath)
    (status == bsBusy ? 1 : 0)
    (startTime, startTime != 0)
    (step->drv.platform)
    ((int) status, status != bsBusy)
    (propagatedFrom, propagatedFrom != 0)
    (errorMsg, errorMsg != "")
    (startTime, startTime != 0 && status != bsBusy)
    (machine).exec();
    [10.8432]
    [7.269]
    auto r = txn.exec_params
    ("insert into BuildSteps (build, stepnr, type, drvPath, busy, startTime, system, status, propagatedFrom, errorMsg, stopTime, machine) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12) on conflict do nothing",
    buildId,
    stepNr,
    0, // == build
    step->drvPath,
    status == bsBusy ? 1 : 0,
    startTime != 0 ? std::make_optional(startTime) : std::nullopt,
    step->drv.platform,
    status != bsBusy ? std::make_optional((int) status) : std::nullopt,
    propagatedFrom != 0 ? std::make_optional(propagatedFrom) : std::nullopt, // internal::params
    errorMsg != "" ? std::make_optional(errorMsg) : std::nullopt,
    startTime != 0 && status != bsBusy ? std::make_optional(startTime) : std::nullopt,
    machine);
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 269
    [10.9041][10.9041:9164](),[10.9164][10.2982:3054]()
    txn.parameterized
    ("insert into BuildStepOutputs (build, stepnr, name, path) values ($1, $2, $3, $4)")
    (buildId)(stepNr)(output.first)(output.second.path).exec();
    [10.9041]
    [10.9238]
    txn.exec_params0
    ("insert into BuildStepOutputs (build, stepnr, name, path) values ($1, $2, $3, $4)",
    buildId, stepNr, output.first, output.second.path);
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 282
    [8.1012][8.1012:1247]()
    if (txn.parameterized
    ("update BuildSteps set busy = $1 where build = $2 and stepnr = $3 and busy != 0 and status is null")
    ((int) stepState)
    (buildId)
    (stepNr)
    .exec().affected_rows() != 1)
    [8.1012]
    [8.1247]
    if (txn.exec_params
    ("update BuildSteps set busy = $1 where build = $2 and stepnr = $3 and busy != 0 and status is null",
    (int) stepState,
    buildId,
    stepNr).affected_rows() != 1)
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 296
    [10.1496][10.391:413](),[10.9600][10.391:413](),[10.9438][10.391:413](),[10.413][10.1497:1848](),[10.1848][10.1316:1349](),[10.973][10.1316:1349](),[10.1349][10.1849:2024]()
    txn.parameterized
    ("update BuildSteps set busy = 0, status = $1, errorMsg = $4, startTime = $5, stopTime = $6, machine = $7, overhead = $8, timesBuilt = $9, isNonDeterministic = $10 where build = $2 and stepnr = $3")
    ((int) result.stepStatus)(buildId)(stepNr)
    (result.errorMsg, result.errorMsg != "")
    (result.startTime)(result.stopTime)
    (machine, machine != "")
    (result.overhead, result.overhead != 0)
    (result.timesBuilt, result.timesBuilt > 0)
    (result.isNonDeterministic, result.timesBuilt > 1)
    .exec();
    [10.1496]
    [9.0]
    txn.exec_params0
    ("update BuildSteps set busy = 0, status = $1, errorMsg = $4, startTime = $5, stopTime = $6, machine = $7, overhead = $8, timesBuilt = $9, isNonDeterministic = $10 where build = $2 and stepnr = $3",
    (int) result.stepStatus, buildId, stepNr,
    result.errorMsg != "" ? std::make_optional(result.errorMsg) : std::nullopt,
    result.startTime, result.stopTime,
    machine != "" ? std::make_optional(machine) : std::nullopt,
    result.overhead != 0 ? std::make_optional(result.overhead) : std::nullopt,
    result.timesBuilt > 0 ? std::make_optional(result.timesBuilt) : std::nullopt,
    result.timesBuilt > 1 ? std::make_optional(result.isNonDeterministic) : std::nullopt);
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 317
    [10.737][7.328:523](),[7.523][10.900:1057](),[10.900][10.900:1057]()
    auto r = txn.parameterized
    ("insert into BuildSteps (build, stepnr, type, drvPath, busy, status, startTime, stopTime) values ($1, $2, $3, $4, $5, $6, $7, $8) on conflict do nothing")
    (build->id)
    (stepNr)
    (1) // == substitution
    (drvPath)
    (0)
    (0)
    (startTime)
    (stopTime).exec();
    [10.737]
    [7.524]
    auto r = txn.exec_params
    ("insert into BuildSteps (build, stepnr, type, drvPath, busy, status, startTime, stopTime) values ($1, $2, $3, $4, $5, $6, $7, $8) on conflict do nothing",
    build->id,
    stepNr,
    1, // == substitution
    drvPath,
    0,
    0,
    startTime,
    stopTime);
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 330
    [10.1058][10.1058:1232]()
    txn.parameterized
    ("insert into BuildStepOutputs (build, stepnr, name, path) values ($1, $2, $3, $4)")
    (build->id)(stepNr)(outputName)(storePath).exec();
    [10.1058]
    [10.1232]
    txn.exec_params0
    ("insert into BuildStepOutputs (build, stepnr, name, path) values ($1, $2, $3, $4)",
    build->id, stepNr, outputName, storePath);
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 399
    [2.1][2.1:117]()
    if (txn.parameterized("select 1 from Builds where id = $1 and finished = 0")(build->id).exec().empty()) return;
    [2.1]
    [10.14683]
    if (txn.exec_params("select 1 from Builds where id = $1 and finished = 0", build->id).empty()) return;
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 401
    [10.14684][10.578:600](),[10.17826][10.578:600](),[10.600][10.191:395](),[10.183][10.18032:18052](),[10.358][10.18032:18052](),[10.395][10.18032:18052](),[10.878][10.18032:18052](),[10.1909][10.18032:18052](),[10.18032][10.18032:18052](),[10.18052][10.296:358](),[10.358][10.18078:18136](),[10.18078][10.18078:18136](),[10.18136][10.601:716]()
    txn.parameterized
    ("update Builds set finished = 1, buildStatus = $2, startTime = $3, stopTime = $4, size = $5, closureSize = $6, releaseName = $7, isCachedBuild = $8, notificationPendingSince = $4 where id = $1")
    (build->id)
    ((int) (res.failed ? bsFailedWithOutput : bsSuccess))
    (startTime)
    (stopTime)
    (res.size)
    (res.closureSize)
    (res.releaseName, res.releaseName != "")
    (isCachedBuild ? 1 : 0).exec();
    [10.14684]
    [2.118]
    txn.exec_params0
    ("update Builds set finished = 1, buildStatus = $2, startTime = $3, stopTime = $4, size = $5, closureSize = $6, releaseName = $7, isCachedBuild = $8, notificationPendingSince = $4 where id = $1",
    build->id,
    (int) (res.failed ? bsFailedWithOutput : bsSuccess),
    startTime,
    stopTime,
    res.size,
    res.closureSize,
    res.releaseName != "" ? std::make_optional(res.releaseName) : std::nullopt,
    isCachedBuild ? 1 : 0);
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 412
    [2.119][2.119:206]()
    txn.parameterized("delete from BuildProducts where build = $1")(build->id).exec();
    [2.119]
    [10.18276]
    txn.exec_params0("delete from BuildProducts where build = $1", build->id);
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 416
    [10.18351][10.717:743](),[10.743][10.18388:18647](),[10.18388][10.18388:18647](),[10.18647][10.744:824](),[10.824][6.174:326](),[6.326][10.18912:19008](),[10.948][10.18912:19008](),[10.18912][10.18912:19008]()
    txn.parameterized
    ("insert into BuildProducts (build, productnr, type, subtype, fileSize, sha1hash, sha256hash, path, name, defaultPath) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)")
    (build->id)
    (productNr++)
    (product.type)
    (product.subtype)
    (product.fileSize, product.isRegular)
    (product.sha1hash.to_string(Base16, false), product.isRegular)
    (product.sha256hash.to_string(Base16, false), product.isRegular)
    (product.path)
    (product.name)
    (product.defaultPath).exec();
    [10.18351]
    [10.19008]
    txn.exec_params0
    ("insert into BuildProducts (build, productnr, type, subtype, fileSize, sha1hash, sha256hash, path, name, defaultPath) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)",
    build->id,
    productNr++,
    product.type,
    product.subtype,
    product.isRegular ? std::make_optional(product.fileSize) : std::nullopt,
    product.isRegular ? std::make_optional(product.sha1hash.to_string(Base16, false)) : std::nullopt,
    product.isRegular ? std::make_optional(product.sha256hash.to_string(Base16, false)) : std::nullopt,
    product.path,
    product.name,
    product.defaultPath);
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 430
    [10.19015][2.207:293]()
    txn.parameterized("delete from BuildMetrics where build = $1")(build->id).exec();
    [10.19015]
    [2.293]
    txn.exec_params0("delete from BuildMetrics where build = $1", build->id);
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 433
    [10.1372][10.1372:1822]()
    txn.parameterized
    ("insert into BuildMetrics (build, name, unit, value, project, jobset, job, timestamp) values ($1, $2, $3, $4, $5, $6, $7, $8)")
    (build->id)
    (metric.second.name)
    (metric.second.unit, metric.second.unit != "")
    (metric.second.value)
    (build->projectName)
    (build->jobsetName)
    (build->jobName)
    (build->timestamp).exec();
    [10.1372]
    [10.1822]
    txn.exec_params0
    ("insert into BuildMetrics (build, name, unit, value, project, jobset, job, timestamp) values ($1, $2, $3, $4, $5, $6, $7, $8)",
    build->id,
    metric.second.name,
    metric.second.unit != "" ? std::make_optional(metric.second.unit) : std::nullopt,
    metric.second.value,
    build->projectName,
    build->jobsetName,
    build->jobName,
    build->timestamp);
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 453
    [10.808][10.1437:1535](),[10.1437][10.1437:1535]()
    if (!txn.parameterized("select 1 from FailedPaths where path = $1")(path).exec().empty())
    [10.808]
    [10.1535]
    if (!txn.exec_params("select 1 from FailedPaths where path = $1", path).empty())
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 679
    [10.2168][10.2168:2269]()
    txn.parameterized("insert into SystemStatus values ('queue-runner', $1)")(out.str()).exec();
    [10.2168]
    [10.2269]
    txn.exec_params0("insert into SystemStatus values ('queue-runner', $1)", out.str());
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 809
    [10.1064][10.1064:1102](),[10.1102][8.1335:1454](),[8.1454][10.1220:1345](),[10.1220][10.1220:1345]()
    txn.parameterized
    ("update BuildSteps set busy = 0, status = $1 where build = $2 and stepnr = $3 and busy != 0")
    ((int) bsAborted)
    (step.first)
    (step.second).exec();
    [10.1064]
    [10.1345]
    txn.exec_params0
    ("update BuildSteps set busy = 0, status = $1 where build = $2 and stepnr = $3 and busy != 0",
    (int) bsAborted,
    step.first,
    step.second);
  • replacement in src/hydra-queue-runner/queue-monitor.cc at line 93
    [10.21931][10.133:170]()
    auto res = txn.parameterized
    [10.21931]
    [3.1211]
    auto res = txn.exec_params
  • replacement in src/hydra-queue-runner/queue-monitor.cc at line 95
    [3.1337][10.286:400](),[10.286][10.286:400]()
    "where id > $1 and finished = 0 order by globalPriority desc, id")
    (lastBuildId).exec();
    [3.1337]
    [10.22108]
    "where id > $1 and finished = 0 order by globalPriority desc, id",
    lastBuildId);
  • replacement in src/hydra-queue-runner/queue-monitor.cc at line 140
    [10.23410][10.23410:23444](),[10.23444][4.0:135](),[4.135][10.23604:23674](),[10.509][10.23604:23674](),[10.23604][10.23604:23674](),[10.23674][4.136:174]()
    txn.parameterized
    ("update Builds set finished = 1, buildStatus = $2, startTime = $3, stopTime = $3 where id = $1 and finished = 0")
    (build->id)
    ((int) bsAborted)
    (time(0)).exec();
    [10.23410]
    [10.23784]
    txn.exec_params0
    ("update Builds set finished = 1, buildStatus = $2, startTime = $3, stopTime = $3 where id = $1 and finished = 0",
    build->id,
    (int) bsAborted,
    time(0));
  • replacement in src/hydra-queue-runner/queue-monitor.cc at line 172
    [10.931][10.931:1236]()
    auto res = txn.parameterized
    ("select max(build) from BuildSteps where drvPath = $1 and startTime != 0 and stopTime != 0 and status = 1")
    (ex.step->drvPath).exec();
    if (!res[0][0].is_null()) propagatedFrom = res[0][0].as<BuildID>();
    [10.931]
    [10.1236]
    auto res = txn.exec_params1
    ("select max(build) from BuildSteps where drvPath = $1 and startTime != 0 and stopTime != 0 and status = 1",
    ex.step->drvPath);
    if (!res[0].is_null()) propagatedFrom = res[0].as<BuildID>();
  • replacement in src/hydra-queue-runner/queue-monitor.cc at line 179
    [10.1341][10.1341:1634]()
    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();
    [10.1341]
    [10.1634]
    auto res = txn.exec_params
    ("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);
  • replacement in src/hydra-queue-runner/queue-monitor.cc at line 190
    [10.3295][10.1956:1990](),[10.1956][10.1956:1990]()
    txn.parameterized
    [10.3295]
    [10.1281]
    txn.exec_params
  • replacement in src/hydra-queue-runner/queue-monitor.cc at line 192
    [10.1435][10.1435:1490](),[10.1490][10.2144:2304](),[10.2144][10.2144:2304]()
    "where id = $1 and finished = 0")
    (build->id)
    ((int) (ex.step->drvPath == build->drvPath ? bsFailed : bsDepFailed))
    (time(0)).exec();
    [10.1435]
    [10.1146]
    "where id = $1 and finished = 0",
    build->id,
    (int) (ex.step->drvPath == build->drvPath ? bsFailed : bsDepFailed),
    time(0));
  • replacement in src/hydra-queue-runner/queue-monitor.cc at line 557
    [10.2652][10.2652:2809]()
    auto res = txn.parameterized
    ("select schedulingShares from Jobsets where project = $1 and name = $2")
    (projectName)(jobsetName).exec();
    [10.2652]
    [10.2809]
    auto res = txn.exec_params1
    ("select schedulingShares from Jobsets where project = $1 and name = $2",
    projectName,
    jobsetName);
  • replacement in src/hydra-queue-runner/queue-monitor.cc at line 563
    [10.2877][10.2877:2942]()
    auto shares = res[0]["schedulingShares"].as<unsigned int>();
    [10.2877]
    [10.2975]
    auto shares = res["schedulingShares"].as<unsigned int>();
  • replacement in src/hydra-queue-runner/queue-monitor.cc at line 569
    [10.3084][10.3084:3112]()
    res = txn.parameterized
    [10.3084]
    [10.3112]
    auto res2 = txn.exec_params
  • replacement in src/hydra-queue-runner/queue-monitor.cc at line 571
    [10.3201][10.3201:3414]()
    "where s.startTime is not null and s.stopTime > $1 and project = $2 and jobset = $3")
    (time(0) - Jobset::schedulingWindow * 10)(projectName)(jobsetName).exec();
    for (auto const & row : res) {
    [10.3201]
    [10.3414]
    "where s.startTime is not null and s.stopTime > $1 and project = $2 and jobset = $3",
    time(0) - Jobset::schedulingWindow * 10,
    projectName,
    jobsetName);
    for (auto const & row : res2) {
  • replacement in src/hydra-queue-runner/queue-monitor.cc at line 609
    [10.280][10.280:315]()
    auto r = txn.parameterized
    [10.280]
    [10.315]
    auto r = txn.exec_params1
  • replacement in src/hydra-queue-runner/queue-monitor.cc at line 612
    [10.454][10.454:585]()
    "where finished = 1 and (buildStatus = 0 or buildStatus = 6) and path = $1")
    (output.second.path).exec();
    [10.454]
    [10.585]
    "where finished = 1 and (buildStatus = 0 or buildStatus = 6) and path = $1",
    output.second.path);
  • replacement in src/hydra-queue-runner/queue-monitor.cc at line 615
    [10.618][10.618:662]()
    BuildID id = r[0][0].as<BuildID>();
    [10.618]
    [10.662]
    BuildID id = r[0].as<BuildID>();
  • replacement in src/hydra-queue-runner/queue-monitor.cc at line 620
    [10.762][10.762:1063]()
    res.failed = r[0][1].as<int>() == bsFailedWithOutput;
    res.releaseName = r[0][2].is_null() ? "" : r[0][2].as<std::string>();
    res.closureSize = r[0][3].is_null() ? 0 : r[0][3].as<unsigned long long>();
    res.size = r[0][4].is_null() ? 0 : r[0][4].as<unsigned long long>();
    [10.762]
    [10.1063]
    res.failed = r[1].as<int>() == bsFailedWithOutput;
    res.releaseName = r[2].is_null() ? "" : r[2].as<std::string>();
    res.closureSize = r[3].is_null() ? 0 : r[3].as<unsigned long long>();
    res.size = r[4].is_null() ? 0 : r[4].as<unsigned long long>();
  • replacement in src/hydra-queue-runner/queue-monitor.cc at line 625
    [10.1064][10.1064:1280]()
    auto products = txn.parameterized
    ("select type, subtype, fileSize, sha1hash, sha256hash, path, name, defaultPath from BuildProducts where build = $1 order by productnr")
    (id).exec();
    [10.1064]
    [10.1280]
    auto products = txn.exec_params
    ("select type, subtype, fileSize, sha1hash, sha256hash, path, name, defaultPath from BuildProducts where build = $1 order by productnr",
    id);
  • replacement in src/hydra-queue-runner/queue-monitor.cc at line 651
    [10.2204][10.2204:2346]()
    auto metrics = txn.parameterized
    ("select name, unit, value from BuildMetrics where build = $1")
    (id).exec();
    [10.2204]
    [10.2346]
    auto metrics = txn.exec_params
    ("select name, unit, value from BuildMetrics where build = $1",
    id);