问题描述:

This is a Jenkins relevant problem.

I have a Jenkins cluster which contains 10 windows slave nodes that are supposed to run the same pipeline(suppose it's job A->B->C)

Suppose I have new job A waiting in the queue, and a slave node just finished a job A and will trigger a job B, how can I make sure that this slave node will run job B first instead of running this long-time-waiting job A.

Thank a lot for your help.


A solution I have tried by using Priority Sorter Plugin, I've set job C with the highest priority, B second, and A with the lowest priority.

I was hoping while choosing a new job to run, the scheduler will schedule the job with higher priority(which in the case above, should be B instead of A)

Yet this solution fails, because scheduler will schedule job(A) to slave node before the newly triggered job(B) is added into Queue and re-sorted.

网友答案:

Even without Priority Sorte +Plugin you should be able to block starting job A by:

  • set Execute concurrent builds if necessary in job's A configuration.
  • add additional Build step Trigger/call builds on other projects and set Block until the triggered projects finish their builds.

You can in the same manner configure jobs B and C, ....

相关阅读:
Top