Handle concurrent finishing of the same build
[?]
Jun 18, 2015, 3:12 PM
HPJKBFZ4C24DNBFESAVVFHOBHXOPYOP4XNPFVGOLA7EPLZCIRS6QCDependencies
- [2]
X7AZHNKGSet finishedInDB in a few more places - [3]
HUUZFPPKFix race between the queue monitor and the builder threads - [4]
GKZN4UV7Make the queue monitor more robust, and better debug output - [5]
YZAI5GQUImplement a database connection pool - [6]
62MQPRXCPass null values to libpqxx properly - [7]
IWB3F4Z6Fail builds with previously failed steps early - [8]
OCZ4LSGGAutomatically retry aborted builds - [9]
ENXUSMSVMake concurrency more robust - [10]
JAUB2FT5getQueuedBuilds(): Handle dependent builds first - [11]
PQFOMNTLhydra-queue-runner: More stats - [12]
N5O7VEEOImmediately abort builds that require an unsupported system type - [13]
24BMQDZAStart of single-process hydra-queue-runner - [14]
FQQRJUO4Mark builds as busy - [15]
UQQ4IL55Add a error type for "unsupported system type" - [16]
MSIHMO45Tweak build steps - [17]
2IQRXLWESupport cancelling builds - [18]
RYTQLATYKeep track of failed paths in the Hydra database - [19]
UPN2SAMLAcquire exclusive table lock earlier - [20]
5AIYUMTBBasic remote building
Change contents
- replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 166
printMsg(lvlError, format("destroying step %1%") % drvPath);//printMsg(lvlError, format("destroying step %1%") % drvPath); - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 523[4.271]→[4.396:430](∅→∅),[4.9876]→[4.396:430](∅→∅),[4.430]→[3.324:366](∅→∅),[3.366]→[4.10645:10675](∅→∅),[4.430]→[4.10645:10675](∅→∅),[4.641]→[4.10645:10675](∅→∅),[4.10645]→[4.10645:10675](∅→∅),[4.10675]→[4.255:394](∅→∅),[4.394]→[4.10804:10994](∅→∅),[4.10804]→[4.10804:10994](∅→∅),[4.10994]→[2.0:40](∅→∅),[2.40]→[4.255:283](∅→∅),[4.10994]→[4.255:283](∅→∅)
pqxx::work txn(conn);assert(!build->finishedInDB);txn.parameterized("update Builds set finished = 1, busy = 0, buildStatus = $2, startTime = $3, stopTime = $3, errorMsg = $4 where id = $1")(build->id)((int) bsAborted)(time(0))("derivation was garbage-collected prior to build").exec();txn.commit();build->finishedInDB = true;nrBuildsDone++;if (!build->finishedInDB) {pqxx::work txn(conn);txn.parameterized("update Builds set finished = 1, busy = 0, buildStatus = $2, startTime = $3, stopTime = $3, errorMsg = $4 where id = $1 and finished = 0")(build->id)((int) bsAborted)(time(0))("derivation was garbage-collected prior to build").exec();txn.commit();build->finishedInDB = true;nrBuildsDone++;} - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 602[4.310]→[4.772:810](∅→∅),[4.810]→[4.0:72](∅→∅),[4.72]→[3.503:549](∅→∅),[4.72]→[4.310:344](∅→∅),[3.549]→[4.310:344](∅→∅),[4.810]→[4.310:344](∅→∅),[4.310]→[4.310:344](∅→∅),[4.344]→[4.811:959](∅→∅),[4.959]→[4.472:504](∅→∅),[4.472]→[4.472:504](∅→∅),[4.504]→[4.960:1093](∅→∅),[4.269]→[4.653:683](∅→∅),[4.1167]→[4.653:683](∅→∅),[4.653]→[4.653:683](∅→∅),[4.683]→[2.41:85](∅→∅),[2.85]→[4.284:316](∅→∅),[4.683]→[4.284:316](∅→∅)
pqxx::work txn(conn);createBuildStep(txn, 0, build, r, "", buildStepStatus);assert(!build->finishedInDB);txn.parameterized("update Builds set finished = 1, busy = 0, buildStatus = $2, startTime = $3, stopTime = $3, isCachedBuild = $4 where id = $1")(build->id)((int) buildStatus)(now)(buildStatus != bsUnsupported ? 1 : 0).exec();txn.commit();build->finishedInDB = true;nrBuildsDone++;if (!build->finishedInDB) {pqxx::work txn(conn);createBuildStep(txn, 0, build, r, "", buildStepStatus);txn.parameterized("update Builds set finished = 1, busy = 0, buildStatus = $2, startTime = $3, stopTime = $3, isCachedBuild = $4 where id = $1 and finished = 0")(build->id)((int) buildStatus)(now)(buildStatus != bsUnsupported ? 1 : 0).exec();txn.commit();build->finishedInDB = true;nrBuildsDone++;} - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 627
(*builds_)[build->id] = build;if (!build->finishedInDB) // FIXME: can this happen?(*builds_)[build->id] = build; - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 1238
assert(!build->finishedInDB);if (build->finishedInDB) continue; - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 1240
("update Builds set finished = 1, busy = 0, buildStatus = $2, startTime = $3, stopTime = $4, isCachedBuild = $5 where id = $1")("update Builds set finished = 1, busy = 0, buildStatus = $2, startTime = $3, stopTime = $4, isCachedBuild = $5 where id = $1 and finished = 0") - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 1278
assert(!build->finishedInDB);if (build->finishedInDB) return; - replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 1281
("update Builds set finished = 1, busy = 0, buildStatus = $2, startTime = $3, stopTime = $4, size = $5, closureSize = $6, releaseName = $7, isCachedBuild = $8 where id = $1")("update Builds set finished = 1, busy = 0, buildStatus = $2, startTime = $3, stopTime = $4, size = $5, closureSize = $6, releaseName = $7, isCachedBuild = $8 where id = $1 and finished = 0") - edit in src/hydra-queue-runner/sync.hh at line 31
Sync() { }Sync(const T & data) : data(data) { }