#1451 backend: prioritize all non-background jobs
Merged 3 years ago by praiskup. Opened 3 years ago by praiskup.

@@ -50,9 +50,9 @@

          priority = self._task.get('priority', 0)

  

          if self.background:

-             priority += PRIORITY_SECTION_SIZE

-         if not self.source_build:

              priority += 2*PRIORITY_SECTION_SIZE

+         if not self.source_build:

+             priority += PRIORITY_SECTION_SIZE

          return priority

  

      @property

@@ -55,7 +55,7 @@

      })) == 1

  

  @pytest.mark.parametrize('background,result',

-                          [(True, PRIORITY_SECTION_SIZE), (False, 0)])

+                          [(True, 2*PRIORITY_SECTION_SIZE), (False, 0)])

  def test_frontend_priority(background, result):

      task = BuildQueueTask({

          "build_id": "9",
@@ -70,4 +70,4 @@

          "project_owner": "cecil",

          "background": background,

      })

-     assert task.frontend_priority == result + 2*PRIORITY_SECTION_SIZE

+     assert task.frontend_priority == result + PRIORITY_SECTION_SIZE

Previously we prioritized all SRPM (even background) tasks, rather than
normal (non-background) tasks. After testing this for some time (about
a month) in production it seems like a slightly better and more fair
variant. This topic was discussed e.g. in #817 #1295.

rebased onto 22c18bbdb09bfb0d4e538faf8545f33a955b36cb

3 years ago

rebased onto 20c1402

3 years ago

Pull-Request has been merged by praiskup

3 years ago