Fix double-triggered build post Git push
It seems to me that sometimes, when pushing to Git, the very same commit is built from twice in a row by Jenkins. E.g.
- https://jenkins.tails.boum.org/job/build_Tails_ISO_feature-jessie/281/
- https://jenkins.tails.boum.org/job/build_Tails_ISO_feature-jessie/282/
… were “Started by an SCM change”, and both built from 038ead81fa7c261b6600e60ccd8144b1b0fc1b00.
This of course will be a serious performance issue whenever we start building more branches, and will make the feedback loop longer than it should be.
Looks like upstream bug 25639, that’s supposedly fixed in Jenking Git plugin 2.2.11.
It might be that this problem happens only when pushing several branches at a time, or when pushing several branches in a row. To be investigated.
Currently, we’re using the curl $JENKINS_URL/git/notifyCommit?url=$GIT_REPO
mechanism in the Git
post-receive
hook, in tails.git on puppet-git.lizard. That repo is fed
via git push --mirror
from our primary Git repo. Maybe we should first
check that the post-receive
hook is run only once per updated branch?
Also, this URL supports a branches=
parameter, which would be worth
trying when debugging this problem.
Might be a bug in the pollscm plugin: it might be that the polling+triggering code only checks what commit a build was last completed from, instead of the commit a build was last started from. But we wouldn’t be the only ones experiencing it.
Parent Task: #6196 (closed)
Original created by @intrigeri on 8692 (Redmine)