提交 e38e687d 编写于 作者: A Andrew Bayer

[FIXED JENKINS-2548] Slaves taken offline for low disk space will now

come back online when disk space becomes available.
上级 3b7e7c7c
......@@ -85,6 +85,9 @@ Upcoming changes</a>
<li class=bug>
Use $JENKINS_USER in Debian postinst script.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-5771">issue 5771</a>)
<li class=bug>
Slaves taken offline due to insufficient disk space should automatically come back online when disk space is cleared.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-2548">issue 2548</a>)
</ul>
</div><!--=TRUNK-END=-->
......
......@@ -45,6 +45,10 @@ public abstract class AbstractDiskSpaceMonitor extends NodeMonitor {
if(getDescriptor().markOffline(c,size)) {
LOGGER.warning(Messages.DiskSpaceMonitor_MarkedOffline(c.getName()));
}
} else if (c.isTemporarilyOffline()) {
if (getDescriptor().markOnline(c)) {
LOGGER.warning(Messages.DiskSpaceMonitor_MarkedOnline(c.getName()));
}
}
return size;
}
......
......@@ -148,6 +148,21 @@ public abstract class AbstractNodeMonitorDescriptor<T> extends Descriptor<Node
return true;
}
/**
* Utility method to mark the computer online for derived classes.
*
* @return true
* if the node was actually brought back online - false if the node was already online.
*/
protected boolean markOnline(Computer c) {
if (!c.isTemporarilyOffline()) return false; // noop
c.setTemporarilyOffline(false);
return true;
}
/**
* @deprecated as of 1.320
* Use {@link #markOffline(Computer, OfflineCause)} to specify the cause.
......
......@@ -23,6 +23,7 @@
ArchitectureMonitor.DisplayName=Architecture
ClockMonitor.DisplayName=Clock Difference
DiskSpaceMonitor.MarkedOffline=Making {0} offline temporarily due to the lack of disk space
DiskSpaceMonitor.MarkedOnline=Bringing {0} online due to disk space recovery
DiskSpaceMonitor.DisplayName=Free Disk Space
ResponseTimeMonitor.DisplayName=Response Time
ResponseTimeMonitor.MarkedOffline=Making {0} offline because it''s not responding
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册