Priority Sorter Plugin

826 views
Skip to first unread message

Adam Mercer

unread,
Feb 12, 2013, 4:12:43 PM2/12/13
to jenkins...@googlegroups.com
Hi

I'm using the Priority Sorter Plugin[1] as I'd like one project to use
the next available build host regardless of the other jobs ahead of it
in the queue. According to the documentation for the plugin:

"This plugin allows jobs waiting in the build queue to be sorted by a
static priority rather than the standard FIFO. Each job is assigned a
priority number and jobs with higher priorities are built first. Jobs
with lower priorities will not run until an executor frees up which no
higher-priority jobs in the build queue can use.

The default priority is 100. Jobs will be ordered in ascending order.
A priority of 50 comes before a priority of 100."

So for the job I'd like to "skip the queue", and build on the next
available host, I assigned a priority of 10, but this seems to be
ignored and jobs are assigned to build hosts in the order in which
they appear in the queue.

Any idea why this priority is being ignored?

Cheers

Adam

[1] <https://wiki.jenkins-ci.org/display/JENKINS/Priority+Sorter+Plugin>

Mandeville, Rob

unread,
Feb 12, 2013, 4:21:42 PM2/12/13
to jenkins...@googlegroups.com
Check the open issues list on that plugin. It looks like jobs kicked off by hand (rather than scheduled automatically) ignore priority sorting. Someone listed that as a feature there. If you kicked off the priority 10 job by hand, or the job that gets ahead of you in the queue was kicked off by hand, that may be your problem. If both were automatically scheduled, I don't know what it is.

--Rob
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


The information in this message is for the intended recipient(s) only and may be the proprietary and/or confidential property of Litle & Co., LLC, and thus protected from disclosure. If you are not the intended recipient(s), or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any use, dissemination, distribution or copying of this communication is prohibited. If you have received this communication in error, please notify Litle & Co. immediately by replying to this message and then promptly deleting it and your reply permanently from your computer.

Merrow, Frank

unread,
Feb 12, 2013, 4:26:28 PM2/12/13
to jenkins...@googlegroups.com

1. Did you restart Jenkins after installing the plugin (if not, do it now)

2. Does the job have a restriction?  Like to "linux" or a specific hostname?

 

The priority module won't force a job to run on a host it wouldn't be allowed to run on without priority.

 

Finally, I'm not sure what "comes before" means . . . I actually looked it up on the Plugin site to make sure you hadn't made it up.  (You didn’t.)

 

All I know if that I use the text from the blue "?" which says:

 

The priority for this job. Priorities are used when all executors are busy to decide which job in the build queue to run next. A job with higher priority is ran before jobs with lower priorities.

 

So the job you want to run first should be 200 . . . not 50.

 

(You’ll find the blue-? Next to the field where you put in the priority (far right).

 

Frank

 

-----Original Message-----
From: jenkins...@googlegroups.com [mailto:jenkins...@googlegroups.com] On Behalf Of Adam Mercer
Sent: Tuesday, February 12, 2013 1:13 PM
To: jenkins...@googlegroups.com
Subject: Priority Sorter Plugin

 

Hi

--

Adam Mercer

unread,
Feb 12, 2013, 4:28:20 PM2/12/13
to jenkins...@googlegroups.com
On Tue, Feb 12, 2013 at 3:21 PM, Mandeville, Rob <rmand...@litle.com> wrote:
> Check the open issues list on that plugin. It looks like jobs kicked off by hand (rather than scheduled automatically) ignore priority sorting. Someone listed that as a feature there. If you kicked off the priority 10 job by hand, or the job that gets ahead of you in the queue was kicked off by hand, that may be your problem. If both were automatically scheduled, I don't know what it is.

I think that may be it, thanks! I've been testing it by manually
queuing builds... I did briefly look over the known issues, not sure
how I missed that one? :-(

Cheers

Adam

Adam Mercer

unread,
Feb 12, 2013, 4:31:35 PM2/12/13
to jenkins...@googlegroups.com
On Tue, Feb 12, 2013 at 3:26 PM, Merrow, Frank <fme...@qti.qualcomm.com> wrote:

> The priority for this job. Priorities are used when all executors are busy
> to decide which job in the build queue to run next. A job with higher
> priority is ran before jobs with lower priorities.
>
> So the job you want to run first should be 200 . . . not 50.

But that contradicts what the documentation on the plugin webpage says:

"The default priority is 100. Jobs will be ordered in ascending order.
A priority of 50 comes before a priority of 100."

Cheers

Adam

Merrow, Frank

unread,
Feb 12, 2013, 4:45:27 PM2/12/13
to jenkins...@googlegroups.com
Yep . . . <shrug> . . .

All I know is if I want to temporally boost the priority of a job without losing what the original value "was" . . . I add a zero on the end, save and it jumps to the front of the queue. At a later time I can come back and remove the zero to return it to its normally assigned priority.

Your mileage may vary.

Frank

-----Original Message-----
From: jenkins...@googlegroups.com [mailto:jenkins...@googlegroups.com] On Behalf Of Adam Mercer

Adam Mercer

unread,
Feb 12, 2013, 4:50:30 PM2/12/13
to jenkins...@googlegroups.com
On Tue, Feb 12, 2013 at 3:45 PM, Merrow, Frank <fme...@qti.qualcomm.com> wrote:
> Yep . . . <shrug> . . .
>
> All I know is if I want to temporally boost the priority of a job without losing what the original value "was" . . . I add a zero on the end, save and it jumps to the front of the queue. At a later time I can come back and remove the zero to return it to its normally assigned priority.
>
> Your mileage may vary.

OK, I'll take a look...

Cheers

Adam

J Arrizza

unread,
Feb 12, 2013, 5:07:52 PM2/12/13
to jenkins...@googlegroups.com
I've been using this plugin for a while (only in Hudson - converting to Jenkins... today.)

The priority number is only used to sort the jobs in the queue and not based on jobs already in the executors. This means:
  • it seems to take a few seconds for the sort to occur. Usually not an issue, but perhaps it's applicable to you.
  • if you have empty executors, the jobs will still be submitted. If you have 6 empty executors and 6 jobs in the queue, all 6 will end up executing at once, no matter what their priority
  • If you have all executors busy, and a backlog of jobs in the queue, then the jobs are sorted in the queue based on their priority,. The next available executor gets the next job, but in this case it will be the highest priority job (of the ones in the queue at the instant the submission occurred).

And one last bit of confusion that still manages to bite me: the higher the priority number, the higher the priority.  For some reason, I think #1 is the highest priority... it isn't, it's the lowest. So your job priority of 10 is low compared to a 100.

John


Adam Mercer

unread,
Feb 12, 2013, 5:13:30 PM2/12/13
to jenkins...@googlegroups.com
On Tue, Feb 12, 2013 at 4:07 PM, J Arrizza <cppg...@gmail.com> wrote:

> And one last bit of confusion that still manages to bite me: the higher the
> priority number, the higher the priority. For some reason, I think #1 is
> the highest priority... it isn't, it's the lowest. So your job priority of
> 10 is low compared to a 100.

Thanks, that's what was confusing me. I've adjusted the priorities
according and I'll see how that effects the behaviour.

Cheers

Adam

Adam Mercer

unread,
Feb 13, 2013, 1:08:46 AM2/13/13
to jenkins...@googlegroups.com
On Tue, Feb 12, 2013 at 4:13 PM, Adam Mercer <rame...@gmail.com> wrote:

> Thanks, that's what was confusing me. I've adjusted the priorities
> according and I'll see how that effects the behaviour.

And that did the trick, jobs are now running with the priority I expect. Thanks!

Cheers

Adam

John A

unread,
Feb 13, 2013, 10:11:28 AM2/13/13
to jenkins...@googlegroups.com



-------- Original Message --------
From: Adam Mercer
Sent: Tue, 12/02/2013 22:08
To: jenkins...@googlegroups.com
CC:
Subject: Re: Priority Sorter Plugin

On Tue, Feb 12, 2013 at 4:13 PM, Adam Mercer wrote:

> Thanks, that's what was confusing me. I've adjusted the priorities
> according and I'll see how that effects the behaviour.

And that did the trick, jobs are now running with the priority I expect. Thanks!

Cheers

Adam

Felipe Reis

unread,
Aug 2, 2013, 2:22:48 PM8/2/13
to jenkins...@googlegroups.com
very good JohnA!!!

Adam Ben-David

unread,
May 20, 2019, 11:45:58 AM5/20/19
to Jenkins Users
Hi All,

I just started to use this plugin, but unfortunately its not super obvious how to make a correct setup.

In our setup we have multiple views:
View A 
View B 
View C

Inside of each view we have a number of individual jobs:
View A.1 
View A.2 
View A.3 

View B.1
View B.2
View B.3

What I am hoping to achieve is the following:
  1. I want to put ALL of View A into a Job Group.
  2. Then I specifically want 1 job inside this group to have the highest priority.

I have attached a screenshot of the setup I configured.

Can someone tell me if this will achieve what I want? 

Thanks! 
Screen_Shot_2019-05-20_at_5_05_17_PM.png

Adam Ben-David

unread,
May 21, 2019, 7:24:08 AM5/21/19
to Jenkins Users
Screen Shot 2019-05-21 at 10.33.28 AM.png

Adam Ben-David

unread,
May 23, 2019, 8:39:05 AM5/23/19
to Jenkins Users
Thanks! 
job-2.png

Baptiste Mathus

unread,
May 31, 2019, 7:18:31 AM5/31/19
to jenkins...@googlegroups.com
Can't you use a special parameter on the high priority jobs?

IIRC from my usage of this plug-in 3 years ago, we have a release=true on some jobs that would make them higher priority than PR builds and the likes.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

Baptiste Mathus

unread,
May 31, 2019, 7:31:26 AM5/31/19
to jenkins...@googlegroups.com
Please do not double/re post.
Thank you

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages