At Hulu we use Jenkins as our continuous integration system. We use it on Windows, Linux, and OS X — depending on the platform of the project.

Recently, we noticed that our Windows build machine exhibited a strange issue. From time to time, some builds were triggered automatically without new commits or any manual operations. We started calling them them "ghost builds". Here's a snippet of our Hipchat log:

PaymentsJenkins Build 4162 for project pay-net-master: SUCCESS. No commits. December 9, 2012
PaymentsJenkins Build 4163 for project pay-net-master: SUCCESS. No commits. December 10, 2012
PaymentsJenkins Build 4164 for project pay-net-master: SUCCESS. No commits. December 10, 2012
PaymentsJenkins Build 4165 for project pay-net-master: SUCCESS. No commits. December 10, 2012
PaymentsJenkins Build 4166 for project pay-net-master: SUCCESS. No commits. December 11, 2012
PaymentsJenkins Build 4167 for project pay-net-master: SUCCESS. No commits. December 11, 2012
PaymentsJenkins Build 4168 for project pay-net-master: SUCCESS. No commits. December 11, 2012
PaymentsJenkins Build 4169 for project pay-net-master: SUCCESS. No commits. December 12, 2012
PaymentsJenkins Build 4170 for project pay-net-master: SUCCESS. No commits. December 12, 2012

Now, errant automated builds don't really hurt anyone. But at some point Sizheng decided that we ought to fix it.

Sizheng Chen   2:52 PMi will pay a decent lunch if anyone can fix the ghost jenkin build issue

So, let's figure out the issue for this "decent lunch".

If you take a look at the log of the ghost build, you'll find something interesting:

Started on Feb 3, 2013 2:40:34 PM
Using strategy: Default
[poll] Last Build : #94
[poll] Last Built Revision: Revision 82846c5e8a046e81c5e20874d2cd767449884304 (origin/develop)
Workspace has a .git repository, but it appears to be corrupt.
No Git repository yet, an initial checkout is required
Done. Took 12 sec
Changes found

Reason
Turns out, this is a common issue in Windows Jenkins. According to JENKINS-11547, the main reason is that there are just too many jobs making git requests at once.
Work Around
Configure Jenkins jobs with a different auto-polling schedule, so that they have less of a chance to overlap.

Here is what I changed:

pay-net-master: Polling SCM: */10 * * * *
pay-net-develop: Polling SCM: */11 * * * *
Result
The ghost builds haven’t occurred any more. And Sizheng owes me a lunch.
Jia Cao is a software developer in our Beijing office.