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

hudson.model.Computer.isIdle() fails to account for fly weight tasks.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Similar Issues:
      Show 5 results

      Description

      The hudson.model.Computer.isIdle() method will indicate that a computer is idle even if there is a fly weight task running on it. I have a cloud plugin for a local cloud system that removes nodes after being idle for a period of time. This causes computers to get removed which are hosting fly weight tasks. Also the method hudson.model.Computer.getIdleStartMilliseconds() may need to take fly weight tasks into account.

        Attachments

          Activity

          Hide
          kohsuke Kohsuke Kawaguchi added a comment -

          We'll put a fix in 1.338, but in the mean time, please set the system property -Dhudson.model.Hudson.flyweightSupport=false to disable the flyweight support.

          Show
          kohsuke Kohsuke Kawaguchi added a comment - We'll put a fix in 1.338, but in the mean time, please set the system property -Dhudson.model.Hudson.flyweightSupport=false to disable the flyweight support.
          Hide
          nairb774 nairb774 added a comment -

          Patch to fix this issue - simple 2 line change.

          Check to see if there are any one off executors running on the computer, and if so report the computer as not idle.

          Show
          nairb774 nairb774 added a comment - Patch to fix this issue - simple 2 line change. Check to see if there are any one off executors running on the computer, and if so report the computer as not idle.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in hudson
          User: : mindless
          Path:
          trunk/hudson/main/core/src/main/java/hudson/model/Computer.java
          http://jenkins-ci.org/commit/26230
          Log:
          JENKINS-5049 patch from nairb774 to check for flyweight tasks in Computer.isIdle()

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : mindless Path: trunk/hudson/main/core/src/main/java/hudson/model/Computer.java http://jenkins-ci.org/commit/26230 Log: JENKINS-5049 patch from nairb774 to check for flyweight tasks in Computer.isIdle()
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in hudson
          User: : mindless
          Path:
          trunk/www/changelog.html
          http://jenkins-ci.org/commit/26231
          Log:
          note JENKINS-5049

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : mindless Path: trunk/www/changelog.html http://jenkins-ci.org/commit/26231 Log: note JENKINS-5049
          Hide
          mindless Alan Harder added a comment -

          shall we mark this resolved, or is something needed for getIdleStartMilliseconds() as mentioned above?

          Show
          mindless Alan Harder added a comment - shall we mark this resolved, or is something needed for getIdleStartMilliseconds() as mentioned above?
          Hide
          nairb774 nairb774 added a comment -

          Patch 001-getIdleStartMilliseconds: Added logic to crawl the one off executors when compiling the idle information.

          Patch 002-countExecutors: I am less sure about this one. In one sense it should be this way, but it may have the ability to break things. For what I could tell it shouldn't but I don't know the code base as well as I would like to make the safety call on this one.

          ~Brian

          Show
          nairb774 nairb774 added a comment - Patch 001-getIdleStartMilliseconds: Added logic to crawl the one off executors when compiling the idle information. Patch 002-countExecutors: I am less sure about this one. In one sense it should be this way, but it may have the ability to break things. For what I could tell it shouldn't but I don't know the code base as well as I would like to make the safety call on this one. ~Brian
          Hide
          mindless Alan Harder added a comment -

          ya, I'll leave out the last one and add javadoc to clarify. It's a minor point, but probably the usage in the remote API is implying configured executors that can do work, and may seem odd if that value fluctuates when one-off tasks are busy.
          thanks for the patches!

          Show
          mindless Alan Harder added a comment - ya, I'll leave out the last one and add javadoc to clarify. It's a minor point, but probably the usage in the remote API is implying configured executors that can do work, and may seem odd if that value fluctuates when one-off tasks are busy. thanks for the patches!
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in hudson
          User: : mindless
          Path:
          trunk/hudson/main/core/src/main/java/hudson/model/Computer.java
          http://jenkins-ci.org/commit/26365
          Log:
          [FIXED JENKINS-5049] check oneOffExecutors in getIdleStartMilliseconds().
          No idle executors in this list, so this just ensures we return a future time if
          there is a busy one-off task but all other executors are idle.
          Added javadoc to clarify what countExecutors() returns.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : mindless Path: trunk/hudson/main/core/src/main/java/hudson/model/Computer.java http://jenkins-ci.org/commit/26365 Log: [FIXED JENKINS-5049] check oneOffExecutors in getIdleStartMilliseconds(). No idle executors in this list, so this just ensures we return a future time if there is a busy one-off task but all other executors are idle. Added javadoc to clarify what countExecutors() returns.

            People

            • Assignee:
              Unassigned
              Reporter:
              nairb774 nairb774
            • Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: