-
New Feature
-
Resolution: Unresolved
-
Major
-
None
Given two jobs:
- Downstream, which has a 60s quiet period
- Upstream, which triggers a parameterized build on Downstream
Now, if you quickly trigger Upstream 3 times, then there will be 3 Downstream jobs in the queue. They will then all run.
We would like parameterized triggering in combination with downstream quiet period to behave sort of like the SVN quiet period behaves: If Upstream is triggered multiple times, then only the last triggered Downstream will remain in the queue. This will help when you have limited verification resources during development and would like to run a "best effort" approach. It will prevent the queue from continuously growing.
Summary: Before Upstream triggers Downstream, Upstream should remove any instances of Downstream from the queue. This should of course be an option and not the default behavior.
For anyone that may need the same feature. Our current work-around is a rather messy groovy script added to Upstream:
But the script is not 100% stable. It happens to fail (hangs or generates a java.lang.NegativeArraySizeException).
The script is started like this:
java -jar jenkins-cli.jar -s http://jenkins:8080/ groovy ./CancelDownstreamQueue.groovy $JOB_NAME SearchStringForJobsToCancel