Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-67964

Access to temporarily offline cause is impossible

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • All recent Jenkins versions.
    • 2.340

      Issue
      When creating plugins that handle node availability it is necessary to access a node's temporaryOfflineCause so that it can be examined (e.g. to find out which user set it etc.).
      This can be easily done if the node is still connected (== still has a channel) but if another OfflineCause is set (e.g. because of a connection termination) it is impossible to retrieve the temporaryOfflineCause set previously using a Computer's getOfflineCause method which is the only method available to retrieve OfflineCauses.

      Solution
      Currently temporaryOfflineCause is a private attribute of the Node class and has been since it was added 11 years ago.

      The attribute could either be made public or a getter could be added.
      Since the attribute should most likely not be messed with directly from outside - since setTemporarilyOffline should be used for that - I would propose introducing a simple getter.

            Unassigned Unassigned
            tploss Tim Ploss
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: