Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-21103

"Priorities are assigned top down by first match" does not work correctly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: prioritysorter-plugin
    • Labels:
      None
    • Environment:
      Jenkins Priority Sorter Plugin 2.2

      jenkins-1.544-1.1.noarch
      java-1.7.0-openjdk-1.7.0.45-2.4.3.4.el6_5.x86_64
      Linux kera 2.6.32-431.1.2.0.1.el6.x86_64 #1 SMP Fri Dec 13 13:06:13 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
    • Similar Issues:

      Description

      Probably plugin incorrectly assigns priorities to jobs. I have a job in two views: Sonar and All (plugin configuration is in the screenshot). According to the description "priorities are assigned top down by first match" - the job should receive priority 4 (or 3 if user run build) but unfortunately always receives 3 (or 2 if user run build).

        Attachments

          Issue Links

            Activity

            Hide
            agabrys Adam Gabryś added a comment - - edited

            I installed new snapshot (2.4-SNAPSHOT (private-01/02/2014 11:43-emsa)).
            Plugin starts assigning correct priorities

            Jan 02, 2014 12:00:49 PM FINE PrioritySorter.Queue.Items
            New Item: Id: 1 JobName: ing_trunk, jobGroupId: 1, priority: 3, weight: 3.0, status: WAITING
            Jan 02, 2014 12:00:57 PM FINE PrioritySorter.Queue.Items
            Buildable: Id: 1 JobName: ing_trunk, jobGroupId: 1, priority: 3, weight: 3.0, status: BUILDABLE
            Jan 02, 2014 12:00:57 PM FINE PrioritySorter.Queue.Items
            Starting: Id: 1 JobName: ing_trunk, jobGroupId: 1, priority: 3, weight: 3.0, status: BUILDABLE
            Jan 02, 2014 12:03:49 PM FINE PrioritySorter.Queue.Items
            New Item: Id: 2 JobName: ing_trunk_sonar, jobGroupId: 0, priority: 4, weight: 4.0, status: WAITING
            Jan 02, 2014 12:03:57 PM FINE PrioritySorter.Queue.Items
            Buildable: Id: 2 JobName: ing_trunk_sonar, jobGroupId: 0, priority: 4, weight: 4.0, status: BUILDABLE
            Jan 02, 2014 12:03:57 PM FINE PrioritySorter.Queue.Items
            Starting: Id: 2 JobName: ing_trunk_sonar, jobGroupId: 0, priority: 4, weight: 4.0, status: BUILDABLE

            I still get only logs with FINE.

            Show
            agabrys Adam Gabryś added a comment - - edited I installed new snapshot (2.4-SNAPSHOT (private-01/02/2014 11:43-emsa)). Plugin starts assigning correct priorities Jan 02, 2014 12:00:49 PM FINE PrioritySorter.Queue.Items New Item: Id: 1 JobName: ing_trunk, jobGroupId: 1, priority: 3, weight: 3.0, status: WAITING Jan 02, 2014 12:00:57 PM FINE PrioritySorter.Queue.Items Buildable: Id: 1 JobName: ing_trunk, jobGroupId: 1, priority: 3, weight: 3.0, status: BUILDABLE Jan 02, 2014 12:00:57 PM FINE PrioritySorter.Queue.Items Starting: Id: 1 JobName: ing_trunk, jobGroupId: 1, priority: 3, weight: 3.0, status: BUILDABLE Jan 02, 2014 12:03:49 PM FINE PrioritySorter.Queue.Items New Item: Id: 2 JobName: ing_trunk_sonar, jobGroupId: 0, priority: 4, weight: 4.0, status: WAITING Jan 02, 2014 12:03:57 PM FINE PrioritySorter.Queue.Items Buildable: Id: 2 JobName: ing_trunk_sonar, jobGroupId: 0, priority: 4, weight: 4.0, status: BUILDABLE Jan 02, 2014 12:03:57 PM FINE PrioritySorter.Queue.Items Starting: Id: 2 JobName: ing_trunk_sonar, jobGroupId: 0, priority: 4, weight: 4.0, status: BUILDABLE I still get only logs with FINE.
            Hide
            emsa23 Magnus Sandberg added a comment - - edited

            I think that you need to say FINER (or FINEST) and not ALL since I'm doing a check on this to see what to log (now fixed and should log correctly with ALL).

            I also did a permission thing since I sort of expected this to be a security thing and it looks like I'm right.

            Thanks for the help - expect a 2.4 release in the near future.

            Show
            emsa23 Magnus Sandberg added a comment - - edited I think that you need to say FINER (or FINEST) and not ALL since I'm doing a check on this to see what to log (now fixed and should log correctly with ALL). I also did a permission thing since I sort of expected this to be a security thing and it looks like I'm right. Thanks for the help - expect a 2.4 release in the near future.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: emsa23
            Path:
            src/test/java/jenkins/advancedqueue/test/MultipleMatchJobGroupTest.java
            src/test/resources/jenkins/advancedqueue/test/MultipleMatchJobGroupTest/config.xml
            src/test/resources/jenkins/advancedqueue/test/MultipleMatchJobGroupTest/jenkins.advancedqueue.PriorityConfiguration.xml
            src/test/resources/jenkins/advancedqueue/test/MultipleMatchJobGroupTest/jenkins.advancedqueue.PrioritySorterConfiguration.xml
            http://jenkins-ci.org/commit/priority-sorter-plugin/b4743a6b21d00e1d23b858c3edad13c2155b8da2
            Log:
            [TEST] JENKINS-21103 Added test case

            Added testcase for JENKINS-21103:
            "Priorities are assigned top down by first match"
            does not work correctly

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: emsa23 Path: src/test/java/jenkins/advancedqueue/test/MultipleMatchJobGroupTest.java src/test/resources/jenkins/advancedqueue/test/MultipleMatchJobGroupTest/config.xml src/test/resources/jenkins/advancedqueue/test/MultipleMatchJobGroupTest/jenkins.advancedqueue.PriorityConfiguration.xml src/test/resources/jenkins/advancedqueue/test/MultipleMatchJobGroupTest/jenkins.advancedqueue.PrioritySorterConfiguration.xml http://jenkins-ci.org/commit/priority-sorter-plugin/b4743a6b21d00e1d23b858c3edad13c2155b8da2 Log: [TEST] JENKINS-21103 Added test case Added testcase for JENKINS-21103 : "Priorities are assigned top down by first match" does not work correctly
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: emsa23
            Path:
            src/main/java/jenkins/advancedqueue/PriorityConfiguration.java
            http://jenkins-ci.org/commit/priority-sorter-plugin/f91ad339fa9896aa374e2f65300b0af107dcea28
            Log:
            JENKINS-21103 "Priorities (...) first match" does not work correctly

            Since the listener is not called as SYSTEM but rather as a user
            I added impersonating for all getPriority() lookups to make
            sure that the code can read all Views and all Jobs.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: emsa23 Path: src/main/java/jenkins/advancedqueue/PriorityConfiguration.java http://jenkins-ci.org/commit/priority-sorter-plugin/f91ad339fa9896aa374e2f65300b0af107dcea28 Log: JENKINS-21103 "Priorities (...) first match" does not work correctly Since the listener is not called as SYSTEM but rather as a user I added impersonating for all getPriority() lookups to make sure that the code can read all Views and all Jobs.
            Hide
            emsa23 Magnus Sandberg added a comment -

            Fixed in 2.4

            Show
            emsa23 Magnus Sandberg added a comment - Fixed in 2.4

              People

              • Assignee:
                emsa23 Magnus Sandberg
                Reporter:
                agabrys Adam Gabryś
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: