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 added a comment -

          The wrong behaviour is also the cause for JENKINS-11889

          Markus Winter added a comment - The wrong behaviour is also the cause for JENKINS-11889

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

              Created:
              Updated:
              Resolved: