Issue Details (XML | Word | Printable)

Key: HUDSON-5048
Type: Task Task
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: kohsuke
Votes: 1
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Hudson

Resurrect MultiClassLoaderSerializer support

Created: 08/Dec/09 03:42 PM   Updated: 31/Dec/09 02:20 PM   Resolved: 11/Dec/09 02:21 PM
Component/s: core
Affects Version/s: None
Fix Version/s: None

Issue Links:
Dependency
 


 Description  « Hide

I'm using this issue to keep track of the MultiClassLoaderSerializer support that was partially implemented then disabled in HUDSON-4293.



Sort Order: Ascending order - Click to sort in descending order
kohsuke added a comment - 08/Dec/09 03:50 PM

To recap, the idea in this code is to record classloader for each class that gets serialized during remoting, so that when deserialized on the remote node, we can correctly recreate multiple classloaders that are involved in the object graph. This code was introduced in rev.21002 and disabled back in rev.21356 after HUDSON-4293 was reported.

I temporarily resurrected this support to see if this solves HUDSON-4993, and instead I discovered a problem.

That is, the code successfully recover the relationship between instances and classes, and classes and their classloaders, but the resulting RemoteClassLoaders do not and cannot recreate relationship among them. Fixing up parent/child relationship won't be enough, as we have custom ClassLoader implementations like DependencyClassLoader. So this ends up loading duplicates of the same class in different classloader in the following scenario:

ClassLoader X owns:
  class A {
    A data;
  }

ClassLoader Y, which delegates to X, owns:
  class B extends A {}

instance to be serialized: A(B)

... because when the definition of B deserializes, its base class A is loaded by the RemoteClassLoader for Y, and not by the RemoteClassLoader for X.


scm_issue_link added a comment - 08/Dec/09 05:47 PM

Code changed in hudson
User: : kohsuke
Path:
trunk/hudson/main/core/src/main/java/hudson/ClassicPluginStrategy.java
trunk/hudson/main/remoting/src/main/java/hudson/remoting/Capability.java
trunk/hudson/main/remoting/src/main/java/hudson/remoting/MultiClassLoaderSerializer.java
trunk/hudson/main/remoting/src/main/java/hudson/remoting/RemoteClassLoader.java
trunk/hudson/main/remoting/src/test/java/hudson/remoting/ChannelTest.java
http://fisheye4.cenqua.com/changelog/hudson/?cs=24490
Log:
HUDSON-5048 Fixed the multi-classloader support in the remoting code. I confirmed that this fixes HUDSON-4993 without modifying the warnings/analysis-core plugin.


scm_issue_link added a comment - 11/Dec/09 02:21 PM

Code changed in hudson
User: : kohsuke
Path:
trunk/www/changelog.html
http://fisheye4.cenqua.com/changelog/hudson/?cs=24567
Log:
[FIXED HUDSON-5048] noting the resurrection of multi classloader support in the remoting in 1.337