-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Description
How to reproduce
- Create an agent with Launch method "Launch agent by connecting it to the controller"
- 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) - Connect the agent.
- Create a freestyle job that should run on that agent exclusively
- 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
- Create an agent with Launch method "Launch agent by connecting it to the controller"
- 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)
- Connect the agent.
- Create a freestyle job that should run on that agent exclusively
- 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)