Skip to content

[JENKINS-55738] NodeMonitor out of disk space message is wrong for master  #20229

Closed

Description

@jenkins-infra-bot

When the master goes out of disk space, it is put offline by the hudson.node_monitors.AbstractDiskSpaceMonitor system.

The message has a blank where the node name should be:

Putting back online as there is enough disk space again

I think this is just because c.getName() returns an empty string in

public Object data(Computer c) {
DiskSpace size = markNodeOfflineIfDiskspaceIsTooLow(c);
// mark online (again), if free space is over threshold
if(size!=null && size.size > getThresholdBytes() && c.isOffline() && c.getOfflineCause() instanceof DiskSpace)
if(this.getClass().equals(((DiskSpace)c.getOfflineCause()).getTrigger()))
if(getDescriptor().markOnline(c)) {
LOGGER.info(Messages.DiskSpaceMonitor_MarkedOnline(c.getName()));
}
return size;
}
/**
* Marks the given node as offline if free disk space is below the configured threshold.
* @param c the node
* @return the free space
* @since 1.521
*/
@Restricted(NoExternalUse.class)
public DiskSpace markNodeOfflineIfDiskspaceIsTooLow(Computer c) {
DiskSpace size = (DiskSpace) super.data(c);
if(size!=null && size.size < getThresholdBytes()) {
size.setTriggered(this.getClass(), true);
if(getDescriptor().markOffline(c,size)) {
LOGGER.warning(Messages.DiskSpaceMonitor_MarkedOffline(c.getName()));
}
}
return size;
}
.

Acceptance criteria

  • This should show master instead of a space as the node name, i.e.

Putting back master online as there is enough disk space


Originally reported by batmat, imported from: NodeMonitor out of disk space message is wrong for master
  • assignee: nisarg14
  • status: Resolved
  • priority: Trivial
  • component(s): core
  • label(s): evergreen-triggered, fosdem2019, newbie-friendly
  • resolution: Fixed
  • resolved: 2019-02-11T22:50:51+00:00
  • votes: 0
  • watchers: 3
  • imported: 2025-11-24
Raw content of original issue

When the master goes out of disk space, it is put offline by the hudson.node_monitors.AbstractDiskSpaceMonitor system.

The message has a blank where the node name should be:

Putting back online as there is enough disk space again

I think this is just because c.getName() returns an empty string in

public Object data(Computer c) {
DiskSpace size = markNodeOfflineIfDiskspaceIsTooLow(c);
// mark online (again), if free space is over threshold
if(size!=null && size.size > getThresholdBytes() && c.isOffline() && c.getOfflineCause() instanceof DiskSpace)
if(this.getClass().equals(((DiskSpace)c.getOfflineCause()).getTrigger()))
if(getDescriptor().markOnline(c)) {
LOGGER.info(Messages.DiskSpaceMonitor_MarkedOnline(c.getName()));
}
return size;
}
/**
* Marks the given node as offline if free disk space is below the configured threshold.
* @param c the node
* @return the free space
* @since 1.521
*/
@Restricted(NoExternalUse.class)
public DiskSpace markNodeOfflineIfDiskspaceIsTooLow(Computer c) {
DiskSpace size = (DiskSpace) super.data(c);
if(size!=null && size.size < getThresholdBytes()) {
size.setTriggered(this.getClass(), true);
if(getDescriptor().markOffline(c,size)) {
LOGGER.warning(Messages.DiskSpaceMonitor_MarkedOffline(c.getName()));
}
}
return size;
}
.

Acceptance criteria

  • This should show master instead of a space as the node name, i.e.

Putting back master online as there is enough disk space

9 attachments

Activity

  1. jenkins-infra-bot commented on Jan 23, 2019

    @jenkins-infra-bot
    Author
    nisarg14:
    • Original comment link
    • Raw content of original comment:

      I would like to work on this issue. So can I assign this to me?

    I would like to work on this issue. So can I assign this to me?

  2. jenkins-infra-bot commented on Jan 23, 2019

    @jenkins-infra-bot
    Author
    batmat:
    • Original comment link
    • Raw content of original comment:

      nisarg14 absolutely, please do. Thanks! If you need help, please reach out to us either on IRC, on on the developers mailing list.

      Thanks again!

    nisarg14 absolutely, please do. Thanks! If you need help, please reach out to us either on IRC, on on the developers mailing list.

    Thanks again!

  3. jenkins-infra-bot commented on Jan 23, 2019

    @jenkins-infra-bot
    Author
    nisarg14:
    • Original comment link
    • Raw content of original comment:

      Sure. Thank you!!

      Actually I am new to open source and also very much excited to contribute.

    Sure. Thank you!!

    Actually I am new to open source and also very much excited to contribute.

  4. jenkins-infra-bot commented on Jan 23, 2019

    @jenkins-infra-bot
    Author
    jglick:
    • Original comment link
    • Raw content of original comment:

      I think it would suffice to use Computer.getDisplayName, which is overridden for MasterComputer.

    I think it would suffice to use Computer.getDisplayName, which is overridden for MasterComputer.

  5. jenkins-infra-bot commented on Jan 23, 2019

    @jenkins-infra-bot
    Author
    nisarg14:
    • Original comment link
    • Raw content of original comment:

      I want to ask few doubts. So which gitter room should I join to discuss? Or should I ask and discuss here?

    I want to ask few doubts. So which gitter room should I join to discuss? Or should I ask and discuss here?

  6. jenkins-infra-bot commented on Jan 23, 2019

    @jenkins-infra-bot
    Author
    jglick:
    • Original comment link
    • Raw content of original comment:

      https://gitter.im/jenkinsci/jenkins is always available for live chat, though I generally feel that if you have a specific question about a specific JIRA issue, commenting in that issue is best unless you think it is a broader topic that many people might want to participate in.

    https://gitter.im/jenkinsci/jenkins is always available for live chat, though I generally feel that if you have a specific question about a specific JIRA issue, commenting in that issue is best unless you think it is a broader topic that many people might want to participate in.

  7. jenkins-infra-bot commented on Jan 23, 2019

    @jenkins-infra-bot
    Author
    nisarg14:
    • Original comment link
    • Raw content of original comment:

      Okay. Thanks

      I will go through some necessary part of the code and will post comments here if required.

    Okay. Thanks

    I will go through some necessary part of the code and will post comments here if required.

  8. jenkins-infra-bot commented on Jan 24, 2019

    @jenkins-infra-bot
    Author
    nisarg14:
    • Original comment link
    • Raw content of original comment:

      If we pass "Putting back online as there is enough disk space again" in Logger.info() then would it be a better behaviour and would it work? As if we change getName() method of Computer class than it would create a problem as this method is used in many places.

    If we pass "Putting back online as there is enough disk space again" in Logger.info() then would it be a better behaviour and would it work? As if we change getName() method of Computer class than it would create a problem as this method is used in many places.

  9. jenkins-infra-bot commented on Jan 24, 2019

    @jenkins-infra-bot
    Author
    jglick:
    • Original comment link
    • Raw content of original comment:

      I suspect replacing the two occurrences of c.getName() in the abovementioned code section with c.getDisplayName() would fix this. Most of the work would be figuring out how to verify the fix.

    I suspect replacing the two occurrences of c.getName() in the abovementioned code section with c.getDisplayName() would fix this. Most of the work would be figuring out how to verify the fix.

  10. jenkins-infra-bot commented on Jan 24, 2019

    @jenkins-infra-bot
    Author
    nisarg14:
    • Original comment link
    • Raw content of original comment:

      Yes it may be. But i looked each and every line where c.getName() is called and i think that it would create issue editing that method. So either we have to call another Display method or we should pass directly the string as it is. And in c.getDisplayName() it gets override by returning nodeName which exactly c.getName() does. So I am not sure but it may probably not work. There are two functions of getDisplayName in which one gets override by returning nodeName.

    Yes it may be. But i looked each and every line where c.getName() is called and i think that it would create issue editing that method. So either we have to call another Display method or we should pass directly the string as it is. And in c.getDisplayName() it gets override by returning nodeName which exactly c.getName() does. So I am not sure but it may probably not work. There are two functions of getDisplayName in which one gets override by returning nodeName.

  11. jenkins-infra-bot commented on Jan 24, 2019

    @jenkins-infra-bot
    Author
    jglick:
    • Original comment link
    • Raw content of original comment:

      The reported issue is about MasterComputer, which overrides getDisplayName as previously noted.

    The reported issue is about MasterComputer, which overrides getDisplayName as previously noted.

  12. jenkins-infra-bot commented on Jan 24, 2019

    @jenkins-infra-bot
    Author
    nisarg14:
    • Original comment link
    • Raw content of original comment:

      Yes issue is of MasterComputer. But if we replace c.getName() with c.getDisplayName() than would it fix this issue? 

    Yes issue is of MasterComputer. But if we replace c.getName() with c.getDisplayName() than would it fix this issue? 

  13. jenkins-infra-bot commented on Jan 24, 2019

    @jenkins-infra-bot
    Author
    jglick:
    • Original comment link
    • Raw content of original comment:

      Maybe you should try it and find out.

    Maybe you should try it and find out.

  14. jenkins-infra-bot commented on Jan 25, 2019

    @jenkins-infra-bot
    Author
    nisarg14:

    #3863

    In these pull request 4 existing tests got failed. Can you please help me in figuring out what happened? As no code of that modules were changed.

  15. jenkins-infra-bot commented on Jan 25, 2019

    @jenkins-infra-bot
    Author
    nisarg14:
    • Original comment link
    • Raw content of original comment:

      Can anyone tell me how can I run tests on my local computer?

    Can anyone tell me how can I run tests on my local computer?

  16. 12 remaining items

  17. jenkins-infra-bot commented on Feb 7, 2019

    @jenkins-infra-bot
    Author
    batmat:
    • Original comment link
    • Raw content of original comment:

      Answered in the open GitHub Pull Request.

    Answered in the open GitHub Pull Request.

  18. jenkins-infra-bot commented on Feb 8, 2019

    @jenkins-infra-bot
    Author
    nisarg14:
    • Original comment link
    • Raw content of original comment:

      batmat

      I have tested he fix and attaching screenshot of the output of Jenkins Window and CLI.

      And I think this fix has resolved the issue of displaying null message.

       

       

    batmat

    I have tested he fix and attaching screenshot of the output of Jenkins Window and CLI.

    And I think this fix has resolved the issue of displaying null message.

     

     

  19. jenkins-infra-bot commented on Feb 8, 2019

    @jenkins-infra-bot
    Author
    batmat:
    • Original comment link
    • Raw content of original comment:

      nisarg14 the goal here is to fix the message explained in the description.

      See the acceptance criteria above. You need to see how Jenkins reacts when you remove the big files and have enough disk space again.

    nisarg14 the goal here is to fix the message explained in the description.

    See the acceptance criteria above.
    You need to see how Jenkins reacts when you remove the big files and have enough disk space again.

  20. jenkins-infra-bot commented on Feb 8, 2019

    @jenkins-infra-bot
    Author
    nisarg14:
    • Original comment link
    • Raw content of original comment:

      batmat

      I am attaching the screenshot of the message before the fix : 

      I have marked the issue with red marker.

    batmat

    I am attaching the screenshot of the message before the fix : 

    I have marked the issue with red marker.

  21. jenkins-infra-bot commented on Feb 8, 2019

    @jenkins-infra-bot
    Author
    nisarg14:
    • Original comment link
    • Raw content of original comment:

      batmat

      I am attaching the screenshot of message after the fix.

      And I think the issue is solved as per acceptance criteria.

       

    batmat

    I am attaching the screenshot of message after the fix.

    And I think the issue is solved as per acceptance criteria.

     

  22. jenkins-infra-bot commented on Feb 11, 2019

    @jenkins-infra-bot
    Author
    oleg_nenashev:
    • Original comment link
    • Raw content of original comment:

      The fix has been released in Jenkins 2.164. Thanks nisarg14!

    The fix has been released in Jenkins 2.164. Thanks nisarg14!

  23. removed
    bugFor changelog: Minor bug. Will be listed after features
    on Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions