-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JENKINS-72009, JENKINS-72200, JENKINS-24947] various fixes and improvements around disk space monitoring #8593
Conversation
Introduces a NodeProperty to define agent specific thresholds for free disk and temp space. Enhance the tooltip in the executor widget so it includes the threshold Show a tooltip in the nodes table when agent was marked offline todo: add a warning threshold
629bb74
to
6055faa
Compare
I wasn't able to add the following labels: needs-more-review Check that the label exists and is spelt right then try again. |
/label needs-more-reviews |
@jenkinsci/core-pr-reviewers |
recover getGbLeft behaviour but deprecate it
99f627d
to
41e91c6
Compare
41e91c6
to
217abce
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine from a security perspective
* Returns the HTML representation of the space. | ||
*/ | ||
public String toHtml() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not accurate anymore, it will never return HTML
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like the direction this is moving very much. Interactive testing found no issues. Thanks!
core/src/main/resources/hudson/node_monitors/DiskSpaceMonitorNodeProperty/config.jelly
Show resolved
Hide resolved
core/src/main/resources/hudson/node_monitors/DiskSpaceMonitor/column.jelly
Show resolved
Hide resolved
Interactive testing showed that all the settings worked very well. I confirmed that the settings are visible through configuration as code and that agents are taken offline when the thresholds are exceeded. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks very much!
[JENKINS-72284] when an agent with wrong java version connects, it will be taken offline right away. Before the agent was only taken offline when one visited the /computer page. Use monitor specific offline causes that inherit from MonitorOfflineCause. This allows to take the agent automatically online again, after it was restarted with the correct java/remoting version. Also with jenkinsci/jenkins#8618 it would then reset the Admin monitor if that was the only reason that it fired. Requires jenkinsci/jenkins#8593 that made 2 mthods public.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/label ready-for-merge
This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback.
Thanks!
* improve how agents are token offline and online [JENKINS-72284] when an agent with wrong java version connects, it will be taken offline right away. Before the agent was only taken offline when one visited the /computer page. Use monitor specific offline causes that inherit from MonitorOfflineCause. This allows to take the agent automatically online again, after it was restarted with the correct java/remoting version. Also with jenkinsci/jenkins#8618 it would then reset the Admin monitor if that was the only reason that it fired. Requires jenkinsci/jenkins#8593 that made 2 mthods public. * fix spotless * order imports * update core version * remove disconnect * Spotless format * keep disconnect methods for casc backwards compatibility * keep disconnect help for CasC * spotless --------- Co-authored-by: Mark Waite <[email protected]>
this.freeSpaceThreshold = "1GB"; | ||
this.freeSpaceThreshold = "1GiB"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: this is one of the unusual cases where a settings format change is not forward-compatible. So if you run a controller from a version after this PR and then downgrade to a version prior to it and try to save monitor config, you will get an error
java.lang.NumberFormatException: For input string: "1GI"
at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)
at java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
at java.base/java.lang.Double.parseDouble(Double.java:792)
at hudson.node_monitors.DiskSpaceMonitorDescriptor$DiskSpace.parse(DiskSpaceMonitorDescriptor.java:163)
at hudson.node_monitors.AbstractDiskSpaceMonitor.<init>(AbstractDiskSpaceMonitor.java:23)
at hudson.node_monitors.DiskSpaceMonitor.<init>(DiskSpaceMonitor.java:49)
at …
Caused: java.lang.IllegalArgumentException: Failed to instantiate class hudson.node_monitors.DiskSpaceMonitor from {"freeSpaceThreshold":"1GiB"}
at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:771)
at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:551)
at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:546)
at hudson.model.Descriptor.bindJSON(Descriptor.java:623)
at hudson.model.Descriptor.newInstance(Descriptor.java:593)
Caused: java.lang.LinkageError: Failed to instantiate class hudson.node_monitors.DiskSpaceMonitor from {"freeSpaceThreshold":"1GiB"}
at hudson.model.Descriptor.newInstance(Descriptor.java:596)
at hudson.util.DescribableList.rebuild(DescribableList.java:183)
at hudson.model.ComputerSet.doConfigSubmit(ComputerSet.java:355)
at …
JENKINS-24947:
JENKINS-72009
JENKINS-72200:
an admin monitor for disk space warnings is very hard to implement, so skipping for now
support-core and metrics plugin should be adjusted to reflect agent individual thresholds.
See JENKINS-72009
JENKINS-72200
JENKINS-24947
Testing done
Proposed changelog entries
Proposed upgrade guidelines
N/A
Submitter checklist
Desired reviewers
N/A
Before the changes are marked as
ready-for-merge
:Maintainer checklist