Fix segfault sorting runnable steps
[?]
Mar 2, 2016, 12:59 PM
PDJCVDVY6R4ZCBELQR3KXPJ3LE7TVXG6N74USR7HWBOIE2P6HDAACDependencies
- [2]
UPNGFCXGFor completeness, re-implement meta.schedulingPriority - [3]
TTBLPQAJKeep track of wait time per system type - [4]
EYR3EW6JKeep stats for the Hydra auto scaler - [5]
46ADBTMQStart steps in order of ascending build ID - [6]
5N7LVAJNKeep track of requiredSystemFeatures in the machine stats - [7]
WE5Q2NVIAllow build to be bumped to the front of the queue via the web interface - [8]
4I2HF4L3Unindent - [9]
IK2UBDAURevive jobset scheduling - [10]
MHVIT4JYSplit hydra-queue-runner.cc more - [*]
HJOEIMLRRefactor
Change contents
- replacement in src/hydra-queue-runner/dispatcher.cc at line 147
std::vector<Step::ptr> runnableSorted;struct StepInfo{Step::ptr step;/* The lowest share used of any jobset depending on thisstep. */double lowestShareUsed = 1e9;/* Info copied from step->state to ensure that thecomparator is a partial ordering (see MachineInfo). */int highestGlobalPriority;int highestLocalPriority;BuildID lowestBuildID;StepInfo(Step::ptr step, Step::State & step_) : step(step){for (auto & jobset : step_.jobsets)lowestShareUsed = std::min(lowestShareUsed, jobset->shareUsed());highestGlobalPriority = step_.highestGlobalPriority;highestLocalPriority = step_.highestLocalPriority;lowestBuildID = step_.lowestBuildID;}};std::vector<StepInfo> runnableSorted; - edit in src/hydra-queue-runner/dispatcher.cc at line 178
- edit in src/hydra-queue-runner/dispatcher.cc at line 180
- replacement in src/hydra-queue-runner/dispatcher.cc at line 200[4.3859]→[4.3859:3929](∅→∅),[4.3929]→[3.364:476](∅→∅),[3.476]→[4.3929:4105](∅→∅),[4.3929]→[4.3929:4105](∅→∅),[4.18166]→[4.18166:18222](∅→∅)
{auto step_(step->state.lock());r.waitTime += std::chrono::duration_cast<std::chrono::seconds>(now - step_->runnableSince);if (step_->tries > 0 && step_->after > now) {if (step_->after < sleepUntil)sleepUntil = step_->after;continue;}auto step_(step->state.lock());r.waitTime += std::chrono::duration_cast<std::chrono::seconds>(now - step_->runnableSince);if (step_->tries > 0 && step_->after > now) {if (step_->after < sleepUntil)sleepUntil = step_->after;continue; - replacement in src/hydra-queue-runner/dispatcher.cc at line 208
runnableSorted.push_back(step);runnableSorted.emplace_back(step, *step_); - edit in src/hydra-queue-runner/dispatcher.cc at line 212
for (auto & step : runnableSorted) {auto step_(step->state.lock());step_->lowestShareUsed = 1e9;for (auto & jobset : step_->jobsets)step_->lowestShareUsed = std::min(step_->lowestShareUsed, jobset->shareUsed());} - replacement in src/hydra-queue-runner/dispatcher.cc at line 213
[](const Step::ptr & a, const Step::ptr & b)[](const StepInfo & a, const StepInfo & b) - edit in src/hydra-queue-runner/dispatcher.cc at line 215
auto a_(a->state.lock());auto b_(b->state.lock()); // FIXME: deadlock? - replacement in src/hydra-queue-runner/dispatcher.cc at line 216[4.23]→[4.23:156](∅→∅),[4.156]→[4.1194:1303](∅→∅),[4.1303]→[2.1081:1210](∅→∅),[2.1210]→[4.156:215](∅→∅),[4.1303]→[4.156:215](∅→∅),[4.156]→[4.156:215](∅→∅)
a_->highestGlobalPriority != b_->highestGlobalPriority ? a_->highestGlobalPriority > b_->highestGlobalPriority :a_->lowestShareUsed != b_->lowestShareUsed ? a_->lowestShareUsed < b_->lowestShareUsed :a_->highestLocalPriority != b_->highestLocalPriority ? a_->highestLocalPriority > b_->highestLocalPriority :a_->lowestBuildID < b_->lowestBuildID;a.highestGlobalPriority != b.highestGlobalPriority ? a.highestGlobalPriority > b.highestGlobalPriority :a.lowestShareUsed != b.lowestShareUsed ? a.lowestShareUsed < b.lowestShareUsed :a.highestLocalPriority != b.highestLocalPriority ? a.highestLocalPriority > b.highestLocalPriority :a.lowestBuildID < b.lowestBuildID; - replacement in src/hydra-queue-runner/dispatcher.cc at line 230
for (auto & step : runnableSorted) {for (auto & stepInfo : runnableSorted) {auto & step(stepInfo.step); - edit in src/hydra-queue-runner/state.hh at line 173
/* The lowest share used of any jobset depending on thisstep. */double lowestShareUsed;