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

Restore compatibility for older versions #743

Merged
merged 1 commit into from
May 16, 2024

Conversation

jtnord
Copy link
Member

@jtnord jtnord commented May 15, 2024

3244.vf7f977e04755 requires the agent to be upgraded in lockstep with Jenkins to avoid remoting errors such as:

java.lang.IllegalStateException: Unable to call getName. No matching method found in [interface hudson.remoting.RemoteClassLoader$IClassLoader] for hudson.remoting.RemoteClassLoader$ClassLoaderProxy@2cdf8d8a[jdk.internal.loader.ClassLoaders$AppClassLoader@2cdf8d8a]

This restores the compatibility by catching the IllegalStateException when calling proxy.getName() and returning a dummy value

Testing done

  • updated Jenkins core to this version and obseved the OldRemotingAgentTest no longer fails.
  • connected an agent with this patch to an older jenkins (2.426.3).
    ** validated it connected
    ** ran Jenkins.class.getClassLoader().getName() in the agents script console and verified the result is expected upgrade-remoting-to-3244.vf7f977e04755-or-higher 0x3043a782

Submitter checklist

3244.vf7f977e04755 requires the agent to be upgraded in lockstep with
Jenkins to avoid remoting errors such as:

java.lang.IllegalStateException: Unable to call getName. No matching method found in [interface hudson.remoting.RemoteClassLoader$IClassLoader] for hudson.remoting.RemoteClassLoader$ClassLoaderProxy@2cdf8d8a[jdk.internal.loader.ClassLoaders$AppClassLoader@2cdf8d8a]

This restores the compatability by specifically handling a method call
to getName for the IClassLoader and returning a dummy value if the
remote version is older than 3244
@jtnord jtnord force-pushed the restore-compatability branch from e718884 to 5472f9a Compare May 15, 2024 18:36
@jglick jglick changed the title restore compatability for older versions Restore compatibility for older versions May 15, 2024
@Vlatombe
Copy link
Member

Still draft?

@jtnord
Copy link
Member Author

jtnord commented May 16, 2024

Still draft?

from the summary "Still to test, a newer agent.jar connecting to an older Jenkins." which I am doing atm

@jtnord jtnord added the bug For changelog: Fixes a bug. label May 16, 2024
@jtnord
Copy link
Member Author

jtnord commented May 16, 2024

waiting on jenkins check of jenkinsci/jenkins@e0c3211

@jtnord jtnord marked this pull request as ready for review May 16, 2024 11:53
@jtnord jtnord merged commit 65ecb25 into jenkinsci:master May 16, 2024
13 checks passed
@jtnord jtnord deleted the restore-compatability branch May 16, 2024 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For changelog: Fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants