Prefer cached failure over unsupported system type

This commit is contained in:
Eelco Dolstra 2015-06-16 18:00:39 +02:00
parent a984c0badc
commit e02654b3a0

View file

@ -197,12 +197,6 @@ private:
typedef std::list<Machine::ptr> Machines; typedef std::list<Machine::ptr> Machines;
Sync<Machines> machines; Sync<Machines> machines;
/* The currently active builder threads. FIXME: We could re-use
these, but since they're fairly long-running, it's probably not
worth it. */
// std::vector<std::thread> builderThreads;
/* Various stats. */ /* Various stats. */
std::atomic<int> nrQueueWakeups; std::atomic<int> nrQueueWakeups;
@ -536,6 +530,13 @@ void State::getQueuedBuilds(Connection & conn, std::shared_ptr<StoreAPI> store,
BuildStatus buildStatus = bsSuccess; BuildStatus buildStatus = bsSuccess;
BuildStepStatus buildStepStatus = bssFailed; BuildStepStatus buildStepStatus = bssFailed;
if (checkCachedFailure(r, conn)) {
printMsg(lvlError, format("marking build %1% as cached failure") % build->id);
buildStatus = step == r ? bsFailed : bsFailed;
buildStepStatus = bssFailed;
}
if (buildStatus == bsSuccess) {
bool supported = false; bool supported = false;
{ {
auto machines_(machines.lock()); // FIXME: use shared_mutex auto machines_(machines.lock()); // FIXME: use shared_mutex
@ -548,11 +549,6 @@ void State::getQueuedBuilds(Connection & conn, std::shared_ptr<StoreAPI> store,
buildStatus = bsUnsupported; buildStatus = bsUnsupported;
buildStepStatus = bssUnsupported; buildStepStatus = bssUnsupported;
} }
if (checkCachedFailure(r, conn)) {
printMsg(lvlError, format("marking build %1% as cached failure") % build->id);
buildStatus = step == r ? bsFailed : bsFailed;
buildStepStatus = bssFailed;
} }
if (buildStatus != bsSuccess) { if (buildStatus != bsSuccess) {