For completeness, re-implement meta.schedulingPriority

[?]
Aug 12, 2015, 10:05 AM
UPNGFCXGAFSLL2XTBFDIUX2FBPHUCBNRCDRGRSPXCDNTMF3DP44QC

Dependencies

  • [2] IK2UBDAU Revive jobset scheduling
  • [3] ZK76B5ZZ Load the queue in order of global priority
  • [4] MHVIT4JY Split hydra-queue-runner.cc more
  • [5] HJOEIMLR Refactor
  • [6] 4I2HF4L3 Unindent
  • [7] WE5Q2NVI Allow build to be bumped to the front of the queue via the web interface
  • [8] 46ADBTMQ Start steps in order of ascending build ID
  • [9] T5BIOVJE Add support for tracking custom metrics

Change contents

  • edit in src/hydra-queue-runner/dispatcher.cc at line 120
    [4.2621]
    [4.17450]
    /* Sort the runnable steps by priority. Priority is establised
    as follows (in order of precedence):
    - The global priority of the builds that depend on the
    step. This allows admins to bump a build to the front of
    the queue.
    - The lowest used scheduling share of the jobsets depending
    on the step.
  • replacement in src/hydra-queue-runner/dispatcher.cc at line 131
    [4.17451][4.79:245]()
    /* Sort the runnable steps by priority. FIXME: O(n lg n);
    obviously, it would be better to keep a runnable queue sorted
    by priority. */
    [4.17451]
    [4.245]
    - The local priority of the build, as set via the build's
    meta.schedulingPriority field. Note that this is not
    quite correct: the local priority should only be used to
    establish priority between builds in the same jobset, but
    here it's used between steps in different jobsets if they
    happen to have the same lowest used scheduling share. But
    that's not every likely.
    - The lowest ID of the builds depending on the step;
    i.e. older builds take priority over new ones.
    FIXME: O(n lg n); obviously, it would be better to keep a
    runnable queue sorted by priority. */
  • edit in src/hydra-queue-runner/dispatcher.cc at line 189
    [2.1303]
    [4.156]
    a_->highestLocalPriority != b_->highestLocalPriority ? a_->highestLocalPriority > b_->highestLocalPriority :
  • replacement in src/hydra-queue-runner/queue-monitor.cc at line 70
    [3.170][3.170:286]()
    ("select id, project, jobset, job, drvPath, maxsilent, timeout, timestamp, globalPriority from Builds "
    [3.170]
    [3.286]
    ("select id, project, jobset, job, drvPath, maxsilent, timeout, timestamp, globalPriority, priority from Builds "
  • edit in src/hydra-queue-runner/queue-monitor.cc at line 91
    [4.748]
    [2.2190]
    build->localPriority = row["priority"].as<int>();
  • edit in src/hydra-queue-runner/queue-monitor.cc at line 263
    [4.1233]
    [4.1233]
    step_->highestLocalPriority = std::max(step_->highestLocalPriority, localPriority);
  • replacement in src/hydra-queue-runner/state.hh at line 108
    [4.2196][4.1964:1988]()
    int globalPriority;
    [4.2196]
    [4.2196]
    int localPriority, globalPriority;
  • edit in src/hydra-queue-runner/state.hh at line 166
    [2.4565]
    [4.2151]
    /* The highest local priority of any build depending on this
    step. */
    int highestLocalPriority{0};