-
Notifications
You must be signed in to change notification settings - Fork 22
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-72284] Take agents offline and online immediately #198
Conversation
[JENKINS-72284] when an agent with wrong java version connects, it will be taken offline right away. Before the agent was only taken offline when one visited the /computer page. Use monitor specific offline causes that inherit from MonitorOfflineCause. This allows to take the agent automatically online again, after it was restarted with the correct java/remoting version. Also with jenkinsci/jenkins#8618 it would then reset the Admin monitor if that was the only reason that it fired. Requires jenkinsci/jenkins#8593 that made 2 mthods public.
Anything missing here? i really like to have the warning automatically disabled when node is online again. Currently this needs a jenkins restart |
I was waiting for the pull request to no longer have conflicting files and to not be a draft pull request. Have you run it in your environment? Does it meet your needs? If so, then you can use the incremental build. |
I need to review the behaviour and remove the now duplicate disconnect for the jvm monitor |
@MarkEWaite fixed the casc issue |
|
||
// should be restricted/deprecated but that breaks casc | ||
@DataBoundSetter | ||
public void setDisconnect(boolean disconnect) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That method is required for backward compatibility with CasC. Ideally it should be deprecated (likewise isDisconnected should also be deprecated). But when doing so CasC will fail unless one adds
configuration-as-code:
version: 1
deprecated: warn
to the CasC config.
Similarly using @Restricted(DoNotUse.class)
makes CasC fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks very much. Testing looks good. Ready to release.
[JENKINS-72284] Take agents offline and online immediately
[JENKINS-72284] when an agent with the wrong java version connects, it will be taken offline right away. Previously, the agent was only taken offline when one visited the /computer page.
Use monitor specific offline causes that inherit from
MonitorOfflineCause
. This allows the agent to be brought online again automatically, after it has been restarted with the correct java/remoting version. Jenkins 2.433 and later will then reset the Admin monitor if that was the only reason that the agent was taken offline.Jenkins core 2.434 or newer made 2 methods public that are required for this pull request.
Requires Jenkins 2.440 or newer because that has been selected as the next LTS baseline.
Testing done
I compared 2.426.3 with the existing release, 2.444 with the existing release, and 2.444 with the incremental build of this plugin.
2.426.3 and current plugin release
2.444 and current plugin release
2.440.1-rc and this pull request
The new behavior of immediately taking the agent offline and immediately bringing it online when the change is applied is very, very nice. Thanks!
Submitter checklist