Skip to content

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

@jenkins-infra-bot

Description

@jenkins-infra-bot

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)


Originally reported by mawinter69, imported from: SimpleScheduledRetentionStrategy isn't working with inbound agents
  • assignee: mawinter69
  • status: Resolved
  • priority: Major
  • component(s): core
  • resolution: Fixed
  • resolved: 2024-01-01T13:26:25+00:00
  • votes: 0
  • watchers: 1
  • imported: 2025-11-24
Raw content of original issue

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)

  • environment: latest Jenkins core (2.433)

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions