Keep machine stats even when a machine is removed from the machines file

[?]
Sep 2, 2015, 11:31 AM
6IB23Y3Y7N7XYJRSLILYIFAEMZD5WE7YEOGCGXR3G5AQPRP52VIQC

Dependencies

  • [2] 4I2HF4L3 Unindent
  • [3] 5AIYUMTB Basic remote building
  • [4] SODOV2CM Automatically reload $NIX_REMOTE_SYSTEMS when it changes
  • [*] MHVIT4JY Split hydra-queue-runner.cc more
  • [*] 24BMQDZA Start of single-process hydra-queue-runner
  • [*] PLOZBRTR Add command ‘hydra-queue-runner --status’ to show current status
  • [*] HJOEIMLR Refactor

Change contents

  • edit in src/hydra-queue-runner/dispatcher.cc at line 92
    [2.1342]
    [2.1342]
    if (!m.second->enabled) continue;
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 77
    [3.3150][3.3150:3210]()
    if (newMachines.find(m.first) == newMachines.end())
    [3.3150]
    [3.3210]
    if (newMachines.find(m.first) == newMachines.end()) {
  • edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 79
    [3.3289]
    [3.9371]
    /* Add a disabled Machine object to make sure stats are
    maintained. */
    auto machine = std::make_shared<Machine>(*(m.second));
    machine->enabled = false;
    newMachines[m.first] = machine;
    }
  • edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 498
    [8.1878]
    [3.4578]
    nested2.attr("enabled", m->enabled);
  • edit in src/hydra-queue-runner/state.hh at line 203
    [9.3325]
    [9.3325]
    bool enabled{true};