Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-72370][JENKINS-11889] fix SimpleScheduledRetentionStrategy with inbound agents #8717

Merged
merged 1 commit into from
Dec 28, 2023

Conversation

mawinter69
Copy link
Contributor

@mawinter69 mawinter69 commented Nov 24, 2023

By implementing isAcceptingTasks the availability strategy ensures that no builds can start when the agent should not do anything.
The current behaviour with an inbound agent is that controller and agent play jojo. The strategy disconnects the agent, the agents java process detects the disconnect and reconnects to the controller, with the strategy again disconnecting the agent and so on.
So the change will only disconnect the agent when the controller can itself launch the agent, this means inbound agents are not disconnected, to avoid playing jojo. The agent will just not accept new tasks for execution.

The change also avoids the problem in [JENKINS-11889] for outbound agents where the accepting tasks of an agents seems to be not reset when changing the availability strategy to always on.

See JENKINS-72370.
See JENKINS-11889.

Testing done

Manual testing as described in the Jira ticket.

Proposed changelog entries

  • Fix SimpleScheduledRetentionStrategy on inbound agents. Allow suspended agents to again accept tasks when they are reconnected and the configured scheduling policy is enabled.

Proposed upgrade guidelines

N/A

Submitter checklist

Desired reviewers

@mention

Before the changes are marked as ready-for-merge:

Maintainer checklist

…ith inbound agents

by implementing `isAcceptingTasks` the availability strategy ensures
that no builds can start when the agent should not do anything.
The current behaviour with an inbound agent is that the strategy
disconnects the agent, just to get connected again by the agents java
process followed by a disconnection a minute later and so on.
After it is connected, the agent is actually accepting tasks.

Additionally the change will only disconnect the agent when the controller
the controller can itself launch the agent, this means inbound agents
are not connected, to avoid playing jojo. The agent will just not accept
new tasks for execution.

The change also avoids the problem in [JENKINS-11889] for outbound
agents where the accepting tasks of an agents seems to be not reset when
changing the availability strategy to always on.
@NotMyFault NotMyFault added the bug For changelog: Minor bug. Will be listed after features label Dec 4, 2023
@NotMyFault NotMyFault requested a review from a team December 4, 2023 08:20
@NotMyFault NotMyFault requested a review from a team December 22, 2023 20:53
Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/label ready-for-merge


This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback.

Thanks!

@comment-ops-bot comment-ops-bot bot added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Dec 24, 2023
@NotMyFault NotMyFault merged commit 3a92445 into jenkinsci:master Dec 28, 2023
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For changelog: Minor bug. Will be listed after features ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants