Pipeline SCM Polling: Break after first "Changes found"

20 views
Skip to first unread message

Stefan Rademacher

unread,
Feb 15, 2018, 10:51:44 AM2/15/18
to Jenkins Users
Hi,

I am running a Jenkins Pipeline, which checks out many repositories (>100).
I am using web hooks to trigger Git SCM polling.

Even though the polling is only triggered, if there was a change in at least one of the repositories, the polling puts our Jenkins instance under heavy load (queueing of forked processes for „git ls-remote“).

What do you think of this simple, little improvement, that could hopefully reduce the polling workload:
Couldn’t the loop, which polls each repository for changes, stop as the first repository returns „changes found"?
https://github.com/jenkinsci/workflow-job-plugin/blob/master/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java#L590

In average, this would reduce the polling duration by 50%. In the best case, the first repository, which is polled, returns „PollingResult.SIGNIFICANT“. In the worst case, the last repository returns „PollingResult.SIGNIFICANT“.

Am I missing anything? I am not so familiar with the Jenkins sources.
What do you think?

Thanks and best regards
Stefan
Reply all
Reply to author
Forward
0 new messages