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

SimpleScheduledRetentionStrategy isn't working with inbound agents

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None
    • latest Jenkins core (2.433)
    • 2.439

      How to reproduce

      1. Create an agent with Launch method "Launch agent by connecting it to the controller"
      2. Set Availability to "Bring this agent online according to a schedule"
        Configure Startup schedule to "0 0 * * *" and scheduled uptime to "5" (basically the agent should not accept tasks)
      3. Connect the agent.
      4. Create a freestyle job that should run on that agent exclusively
      5. run the job

      Expected result

      the job never runs

      Actual result

      the job gets executed

       

      Details

      SimpleScheduledRetentionStrategy disconnects agents and then does computer.setAcceptingTasks(false)

      After a few seconds after the disconnection, the agents java process reconnects the agent which also sets the setAcceptingTasks to true for the agent.

       

      Fix

      SimpleScheduledRetentionStrategy should implement isAcceptingTasks and remove the explicit calls to __ computer.setAcceptingTasks(false)

          [JENKINS-72370] SimpleScheduledRetentionStrategy isn't working with inbound agents

          Markus Winter created issue -
          Markus Winter made changes -
          Link New: This issue relates to JENKINS-11889 [ JENKINS-11889 ]
          Markus Winter made changes -
          Assignee New: Markus Winter [ mawinter69 ]
          Markus Winter made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Mark Waite made changes -
          Remote Link New: This issue links to "PR-8717 Jenkins core pull request that resolves the issue (Web Link)" [ 29408 ]
          Mark Waite made changes -
          Released As New: 2.439
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Fixed but Unreleased [ 10203 ]
          Mark Waite made changes -
          Status Original: Fixed but Unreleased [ 10203 ] New: Resolved [ 5 ]

            mawinter69 Markus Winter
            mawinter69 Markus Winter
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: