diff --git a/changelog.html b/changelog.html index b67b7a95fb01880d02067db73fc111220138115b..7374780dd7817ff3f2bd6fd2435ab3e40a1ea1c9 100644 --- a/changelog.html +++ b/changelog.html @@ -55,6 +55,9 @@ Upcoming changes
,R extends A } } - // build now, or nothing will ever be built + // At this point we start thinking about triggering a build just to get a workspace, + // because otherwise there's no way we can detect changes. + // However, first there are some conditions in which we do not want to do so. + + // give time for slaves to come online if we are right after reconnection (JENKINS-8408) + long running = Jenkins.getInstance().getInjector().getInstance(Uptime.class).getUptime(); + long remaining = TimeUnit2.MINUTES.toMillis(10)-running; + if (remaining>0) { + listener.getLogger().print(Messages.AbstractProject_AwaitingWorkspaceToComeOnline(remaining/1000)); + listener.getLogger().println( " (" + workspaceOfflineReason.name() + ")"); + return NO_CHANGES; + } + Label label = getAssignedLabel(); if (label != null && label.isSelfLabel()) { // if the build is fixed on a node, then attempting a build will do us @@ -1541,17 +1555,19 @@ public abstract class AbstractProject
,R extends A listener.getLogger().println( " (" + workspaceOfflineReason.name() + ")"); return NO_CHANGES; } + listener.getLogger().println( ws==null ? Messages.AbstractProject_WorkspaceOffline() : Messages.AbstractProject_NoWorkspace()); if (isInQueue()) { listener.getLogger().println(Messages.AbstractProject_AwaitingBuildForWorkspace()); return NO_CHANGES; - } else { - listener.getLogger().print(Messages.AbstractProject_NewBuildForWorkspace()); - listener.getLogger().println( " (" + workspaceOfflineReason.name() + ")"); - return BUILD_NOW; } + + // build now, or nothing will ever be built + listener.getLogger().print(Messages.AbstractProject_NewBuildForWorkspace()); + listener.getLogger().println( " (" + workspaceOfflineReason.name() + ")"); + return BUILD_NOW; } else { WorkspaceList l = b.getBuiltOn().toComputer().getWorkspaceList(); return pollWithWorkspace(listener, scm, b, ws, l); diff --git a/core/src/main/resources/hudson/model/Messages.properties b/core/src/main/resources/hudson/model/Messages.properties index e45af741e129bc12416c2219929baf6f58bd39ff..5aa0f13777e87cca3054b1d8f3d544497f77ba6a 100644 --- a/core/src/main/resources/hudson/model/Messages.properties +++ b/core/src/main/resources/hudson/model/Messages.properties @@ -33,6 +33,7 @@ AbstractItem.Pronoun=Job AbstractProject.AssignedLabelString_NoMatch_DidYouMean=There\u2019s no slave/cloud that matches this assignment. Did you mean \u2018{1}\u2019 instead of \u2018{0}\u2019? AbstractProject.NewBuildForWorkspace=Scheduling a new build to get a workspace. AbstractProject.AwaitingBuildForWorkspace=Awaiting build to get a workspace. +AbstractProject.AwaitingWorkspaceToComeOnline=We need to schedule a new build to get a workspace, but deferring {0}ms in the hope that one will become available soon AbstractProject.Pronoun=Project AbstractProject.Aborted=Aborted AbstractProject.BuildInProgress=Build #{0} is already in progress{1}