getQueuedBuilds(): Periodically stop to handle priority bumps

[?]
Oct 22, 2015, 3:00 PM
RND7XFNHXVORJ6JPEHGS7PCIW7DMOTWMZQPTEMXWLR7CZUQ2VCQQC

Dependencies

  • [2] ZK76B5ZZ Load the queue in order of global priority
  • [3] T5BIOVJE Add support for tracking custom metrics
  • [4] VQISTKOP hydra-queue-runner: Use substitutes
  • [5] OG3Z3QGC Namespace cleanup
  • [6] MHVIT4JY Split hydra-queue-runner.cc more
  • [7] HJOEIMLR Refactor
  • [8] WE5Q2NVI Allow build to be bumped to the front of the queue via the web interface
  • [9] ACBS7C6Q hydra-queue-runner: Detect changes to the scheduling shares

Change contents

  • replacement in src/hydra-queue-runner/queue-monitor.cc at line 39
    [3.20820][3.20820:20872]()
    getQueuedBuilds(*conn, store, lastBuildId);
    [3.20820]
    [3.20872]
    bool done = getQueuedBuilds(*conn, store, lastBuildId);
  • replacement in src/hydra-queue-runner/queue-monitor.cc at line 43
    [3.20964][3.20964:21026]()
    conn->await_notification();
    nrQueueWakeups++;
    [3.20964]
    [3.21026]
    if (done) {
    conn->await_notification();
    nrQueueWakeups++;
    } else
    conn->get_notifs();
  • replacement in src/hydra-queue-runner/queue-monitor.cc at line 67
    [3.21512][3.21512:21620]()
    void State::getQueuedBuilds(Connection & conn, std::shared_ptr<StoreAPI> store, unsigned int & lastBuildId)
    [3.21512]
    [3.21620]
    bool State::getQueuedBuilds(Connection & conn, std::shared_ptr<StoreAPI> store, unsigned int & lastBuildId)
  • edit in src/hydra-queue-runner/queue-monitor.cc at line 76
    [2.132]
    [3.21893]
    unsigned int newLastBuildId = lastBuildId;
  • replacement in src/hydra-queue-runner/queue-monitor.cc at line 91
    [3.22293][3.22293:22345]()
    if (id > lastBuildId) lastBuildId = id;
    [3.22293]
    [3.22345]
    if (id > newLastBuildId) newLastBuildId = id;
  • edit in src/hydra-queue-runner/queue-monitor.cc at line 237
    [3.27972]
    [2.839]
    system_time start = std::chrono::system_clock::now();
  • edit in src/hydra-queue-runner/queue-monitor.cc at line 260
    [3.28655]
    [3.28655]
    /* Stop after a certain time to allow priority bumps to be
    processed. */
    if (std::chrono::system_clock::now() > start + std::chrono::seconds(600)) break;
  • edit in src/hydra-queue-runner/queue-monitor.cc at line 265
    [3.28661]
    [3.28661]
    lastBuildId = newBuildsByID.empty() ? newLastBuildId : newBuildsByID.begin()->first - 1;
    return newBuildsByID.empty();
  • replacement in src/hydra-queue-runner/state.hh at line 380
    [3.2260][3.764:875](),[3.7626][3.764:875]()
    void getQueuedBuilds(Connection & conn, std::shared_ptr<nix::StoreAPI> store, unsigned int & lastBuildId);
    [3.2260]
    [3.7732]
    bool getQueuedBuilds(Connection & conn, std::shared_ptr<nix::StoreAPI> store, unsigned int & lastBuildId);