Sorry for the resurrection, but still seeing this problem 3 years later, thought I'd try to stir the pot again...
JENKINS-1938 largely solves this problem, and it's already released.
I don't believe JENKINS-1938 solves the problem identified here – I think the problems are different, and JENKINS-1938 only solves half of it. From the link in the original description (nabble is down currently, but http://osdir.com/ml/java.hudson.user/2007-06/msg00047.html), the problem is related to this setup:
- Project A
- SCM Polling: */5
- Trigger downstream project: Project B
- Project B
- SCM Polling: */5
- Upstream project: Project A
- Copies build artifacts from Project A
The problem occurs when you commit changes to both Projects A and B within a short period of time (within the polling period). Because SCM polling itself has no dependency graph to determine when each project should be polled (just the crontab-style polling schedule), there's no guarantee which project will see the new commits and start building first.
If Project A is polled first, you can enable the option you mention in JENKINS-1938 and therefore Project B will be blocked until Project A is finished, at which point all is well. But if Project B is polled first, and triggers a build with the new code in the B repository, it will be built against an out-of-date artifact from Project A, and will most likely fail. Then Project A will see be triggered because of the SCM change, which will re-trigger Project B. This time Project B will succeed because it has the appropriate artifact version from Project A. It's the initial failure of Project B that should be avoided if possible.
A solution might be when Project B is preparing to poll SCM, it might check its dependency tree first, and if any upstream projects also have SCM polling enabled, it might prefer to wait until those upstream projects have finished polling before it tries to poll its own SCM. At that point, if the upstream job required a build, it would then be in the queue, and using the upstream/downstream blocking option, both jobs can be pending in the build queue and should complete properly. I admit I haven't looked at the SCM polling logic in Jenkins code yet, so I don't know if that is even feasible. But it certainly isn't fixed by the upstream block option alone.
EDIT:
Perhaps another alternative could be an option inside the "Poll SCM" section for "Poll upstream projects for SCM changes first", and if that's selected have it perform synchronous SCM polling for that project's dependency tree from top-down. To avoid/mitigate duplicate polling, you could even disable the "Poll SCM" option of upstream projects, and rely on the downstream project(s) to trigger the upstream polling – however, that could lead to an unintuitive scenario where disabling a downstream project could prevent upstream projects from polling at all... But if you have projects in this scenario, presumably you would know and understand that, as it is kind of an edge case scenario. Or maybe you don't care that the upstream project may be polled more often than expected.
JENKINS-1938largely solves this problem, and it's already released.