-
Improvement
-
Resolution: Fixed
-
Major
-
None
-
Powered by SuggestiMate
SCM polling jobs that requires a workspace for polling are submitted to the job queue when a capable slave is offline. When the slave comes online, the queued job runs, but the result is usually useless because the version did not have a newer version to build, so the result of the build is "Nothing to do"
[JENKINS-21394] Avoid queuing request for workspace while node is offline
Code changed in jenkins
User: Jens Brejner
Path:
core/src/main/java/hudson/model/AbstractProject.java
http://jenkins-ci.org/commit/jenkins/1b24e6289f7eacdc8338c944f546d3e74cc79df0
Log:
[FIXED JENKINS-21394] Avoid irrelevant job queing while node is offline
Code changed in jenkins
User: Jens Brejner
Path:
core/src/main/java/hudson/model/AbstractProject.java
http://jenkins-ci.org/commit/jenkins/ce5802570681195dee64378e7859b8c24993de5e
Log:
[FIXED JENKINS-21394] Avoid irrelevant job queing while node is offline, unless slave is ondemand type
Code changed in jenkins
User: Mads Nielsen
Path:
test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java
test/src/test/java/hudson/model/ProjectTest.java
http://jenkins-ci.org/commit/jenkins/b98e0abe56511febc776778648df532f830bb2d7
Log:
Added test for JENKINS-21394
Code changed in jenkins
User: Mads Nielsen
Path:
core/src/main/java/hudson/model/AbstractProject.java
http://jenkins-ci.org/commit/jenkins/e8e4f5ad5828d95c14445de7082a508ef13d106f
Log:
[FIXED JENKINS-21394] Revised implementation based on feedback
Code changed in jenkins
User: Mads Nielsen
Path:
core/src/main/java/hudson/model/AbstractProject.java
http://jenkins-ci.org/commit/jenkins/5fe11e27f5f0450bd72b5e611bb82c9728cc7c25
Log:
[FIXED JENKINS-21394] Re-revised the commit. Creted a check for the size of clouds
Code changed in jenkins
User: Mads Nielsen
Path:
core/src/main/java/hudson/model/AbstractProject.java
http://jenkins-ci.org/commit/jenkins/90882046ee126791a772eda48098b2d7691dda2c
Log:
[FIXED JENKINS-21394] Change based on feedback
Code changed in jenkins
User: Oliver Gondža
Path:
core/src/main/java/hudson/model/AbstractProject.java
test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java
test/src/test/java/hudson/model/ProjectTest.java
http://jenkins-ci.org/commit/jenkins/82472d7f2b1981c60c3a32cbd7e90d31d3eb748f
Log:
Merge pull request #1092 from jbrejner/master
[FIXED JENKINS-21394] Avoid irrelevant job queing while node is offline
Conflicts:
test/src/test/java/hudson/model/ProjectTest.java
Integrated in jenkins_main_trunk #3299
[FIXED JENKINS-21394] Avoid irrelevant job queing while node is offline (Revision 1b24e6289f7eacdc8338c944f546d3e74cc79df0)
[FIXED JENKINS-21394] Avoid irrelevant job queing while node is offline, unless slave is ondemand type (Revision ce5802570681195dee64378e7859b8c24993de5e)
Added test for JENKINS-21394 (Revision b98e0abe56511febc776778648df532f830bb2d7)
[FIXED JENKINS-21394] Revised implementation based on feedback (Revision e8e4f5ad5828d95c14445de7082a508ef13d106f)
[FIXED JENKINS-21394] Re-revised the commit. Creted a check for the size of clouds (Revision 5fe11e27f5f0450bd72b5e611bb82c9728cc7c25)
[FIXED JENKINS-21394] Change based on feedback (Revision 90882046ee126791a772eda48098b2d7691dda2c)
Result = SUCCESS
jbrejner : 1b24e6289f7eacdc8338c944f546d3e74cc79df0
Files :
- core/src/main/java/hudson/model/AbstractProject.java
jbrejner : ce5802570681195dee64378e7859b8c24993de5e
Files :
- core/src/main/java/hudson/model/AbstractProject.java
man : b98e0abe56511febc776778648df532f830bb2d7
Files :
- test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java
- test/src/test/java/hudson/model/ProjectTest.java
man : e8e4f5ad5828d95c14445de7082a508ef13d106f
Files :
- core/src/main/java/hudson/model/AbstractProject.java
man : 5fe11e27f5f0450bd72b5e611bb82c9728cc7c25
Files :
- core/src/main/java/hudson/model/AbstractProject.java
man : 90882046ee126791a772eda48098b2d7691dda2c
Files :
- core/src/main/java/hudson/model/AbstractProject.java
Is it possible this change broke something with polling? I updated to the latest version of Jenkins today and now all of my polling jobs keep displaying errors like this:
Started on Apr 22, 2014 10:33:58 AM
We need to schedule a new build to get a workspace, but deferring 8,741ms in the hope that one will become available soon (all_suitable_nodes_are_offline)
Done. Took 0 ms
No changes
These jobs and polling all worked prior to the update.
@Eric, how long has the master been running ? You can get this message the first 10 minutes it runs, because we allow some time for slaves to come online - and I assume that your slaves are online ?
I am not using slaves. I have never used slaves. I have one build server with Jenkins running as (I assume) the master.
It's been up all morning (hours) and the issue keeps happening on every polling attempt.
Edit: reverting to Jenkins 1.559-1.1 through yum seems to address the issue as my builds immediately started polling successfully after reverting.
Thank you.
What are you polling ? ( I mean which kind of SCM ? Subversion, git, ....?)
Would you mind to enable logging and log on AbstractProject ?
I am polling git at intervals between 2 and 5 minutes.
I cannot afford to move to the latest version at this time to facilitate logging. If there's any further information I can provide without going to the latest version I would be happy to provide it.
I am seeing the same issue since the upgrade to 1.560, with git (plugin 2.2.1) polling every minute. How can I enable logs?
I have the same problem using mercurial with a freestyle project and also tried with a new project with no scm as a test with the same result. After a little digging found that changing
<canRoam>true</canRoam>
to
<canRoam>false</canRoam>
in the $JENKINS_HOME/jobs/$JOB_NAME/config.xml file gets the polling working again. Not sure why canRoam is set to true but looking at the source (https://github.com/jbrejner/jenkins-renamed/blob/master/core/src/main/java/hudson/model/AbstractProject.java#L1630)
it causes getAssignedLabel() to return null when the code is most likely expecting it to return Jenkins.getInstance().getSelfLabel(). Changing
if (allNodes.isEmpty() && !(label == Jenkins.getInstance().getSelfLabel())) {
// no master/slave. pointless to talk about nodes
label = null;
}
to
if (allNodes.isEmpty() && label == null) {
// no master/slave. pointless to talk about nodes
label = Jenkins.getInstance().getSelfLabel();
}
may fix the issue but this is my first look at the jenkins source so don't have any idea what else this might affect and certainly haven't tested whether this would work, just a quick guess really.
@Brian, just use the standard jenkins log output, and define a new logger for that name space.
@David, Thank you, very much, changing CanRoam in the job's config.xml is probably a useful workaround. I will test your suggested change later this week, but I am at a customer right now, so it will not be today.
Same issue and same message (all_suitable_nodes_are_offline) for me after upgrading to 1.560!! Starting a build manually works fine.
Since this issue is pretty widespread and seems to affect polling in general, can we please revert for the next release until the cause is identified?
@Christian,Eric I'm on it. I am gonna reproduce this today and hopfully come up with somethin that fixes your issues.
Same issue here with 1.560 and Multiple SCMs plugin (0.3) and GIT plugin (2.2.1) runninf a master without any slaves.
@Steffen
I tried to reproduce this on my local machine.
1) I downloaded a fresh windows installer and installed jenkins 1.560 on my local machine. By default the master comes with 2 built in executors
2) Installed Git 2.2.1 plugin
3) Installed the multiple SCM plugin (0.3).
4) Then i created a job which checks out our local testing repository located here: https://github.com/Praqma/praqma-playground, polling interval set to 1 minute.
What i saw when doing this was that a new job was put in queue and a new build was created after waiting 1 minute.
I Then started creating another commit, committed and saw that it worked again..I also tried deleting workspaces and builds, and commiting again and saw that it once again would kick off.
Do you have any special settings configured for your git plugin? Anything that might help me reproduce this?
@Mads
We run jenkins 1.560 on CentOS (Linux).
I tried to reproduce the behaviour with your testing repo. But this one worked without problems.
One difference is that our repo uses git submodules.
BTW, I've tried various downgrades:
- Downgrade Jenkins itself to 1.559 or earlier does not help.
- Downgrade multiple SCM plugin to 0.2 does not help.
- Downgrade GIT plugin to 2.0 does help.
Thanks for the info Steffen, i did some further testing and i can actually reproduce your issue if i add the special behaviour 'Force polling using workspace' to git it stops working.
It's odd that the issue persists in 1.559, which indicates that this might not be related, since this was introduced in 1.560.
https://groups.google.com/forum/#!topic/jenkinsci-users/HmNjml8LH20 describes workaround which works for me too.
It is not really a good solution because it requires changes in all job configuration.
Thanks Steffen, i think i have a good idea on how to fix this. Stay tuned!
I have the same problem with pooling changes from GIT (all_suitable_nodes_are_offline).
I found that this problem belongs only to the projects with unspecified value "Branches to build", in other words, for the projects which try to build any branch.
For projects which has specified branch, for example "master", pooling changes works fine, as before.
I hope this tip helps find resolution.
BTW: Why issue status is "resolved"?
I don't think that's the issue Marek. I have projects with branches specified (some with hard coded values and some with wildcards) but none without a branch specified.
@Mads
I'have to correct my previous statements.
- Downgrade Jenkins itself to 1.559 or earlier leads to a different behaviour. The "We need to schedule ... (all_suitable_nodes_are_offline)" is gone. But instead the affected jobs are triggered cyclic in a loop (each time scm checks for updates).
- Downgrade multiple SCM plugin to 0.2 has no influence.
- Downgrade GIT plugin to 2.0 completely fixes the problem(s).
So may be we have two different (but related ?) problems here.
Sorry for the confusion.
Is it possible to tell us how long we have to wait until this fix is part of a new version?
As soon as someone decides to merge pull request https://github.com/jenkinsci/jenkins/pull/1215
This need to be merge i ammended my pull request so that it does not have the bug present with https://github.com/jenkinsci/jenkins/pull/1218.
Code changed in jenkins
User: Mads Nielsen
Path:
core/src/main/java/hudson/model/AbstractProject.java
test/src/test/java/hudson/model/ProjectTest.java
http://jenkins-ci.org/commit/jenkins/492a60a69c2bac35578b7d93d6cb7a9f593da2f8
Log:
Fixing JENKINS-22750, regression introduced in JENKINS-21394
Code changed in jenkins
User: Oliver Gondža
Path:
core/src/main/java/hudson/model/AbstractProject.java
test/src/test/java/hudson/model/ProjectTest.java
http://jenkins-ci.org/commit/jenkins/f371bc99685bab5a8bd70a3d461b91024727a5ed
Log:
Merge pull request #1215 from MadsNielsen/JENKINS-21394-Regression
Fixing JENKINS-22750, regression introduced in JENKINS-21394
Code changed in jenkins
User: Mads Nielsen
Path:
test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java
http://jenkins-ci.org/commit/jenkins-test-harness/df1d33f95fd77ccb787812922cbf21088c1964d1
Log:
Added test for JENKINS-21394
Originally-Committed-As: b98e0abe56511febc776778648df532f830bb2d7
Code changed in jenkins
User: Oliver Gondža
Path:
test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java
http://jenkins-ci.org/commit/jenkins-test-harness/18aa6eb6d3a5410804534667f830cacfa5e38ce7
Log:
Merge pull request #1092 from jbrejner/master
[FIXED JENKINS-21394] Avoid irrelevant job queing while node is offline
Conflicts:
test/src/test/java/hudson/model/ProjectTest.java
Originally-Committed-As: 82472d7f2b1981c60c3a32cbd7e90d31d3eb748f
Pull request 1092 ( https://github.com/jenkinsci/jenkins/pull/1092 ) created