Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: JRuby 1.x+
-
Component/s: Core Classes/Modules
-
Labels:None
-
Environment:jruby 1.1.7 (ruby 1.8.6 patchlevel 287) (2009-01-23 rev 6586) [x86_64-java]
-
Number of attachments :
Description
Thread.exclusive (and thus DRb) fails when using jruby-complete.jar outside my checkout directory: https://gist.github.com/7195b5f3ccccde25515a
Ok, I see the problem here. Currently, here's the rough order in which we search for libraries in response to a require call:
And this continues through a few other phases. The problem is that while the thread.rb file is available through the classloader (in jruby-complete.jar) we find the built-in thread.so library sooner, which causes us to skip loading the thread.rb where Thread.exclusive is defined. We don't want to move the classloader searching further up the chain since it's a little slow and most resources will be on command line anyway. But this does underscore the need for us to formalize the load process better than it exists currently, and possible always try JRuby's parent classloader for the resource so jruby-complete.jar works like you would expect.
Marking for 1.2.
- Search for a "builtin" with .rb extension
- Search as a jar: or file: URL with .rb extension
- Search load path with .rb extension
- Search for a "builtin" with .so extension
- Search as a jar: or file: URL with .so extension
- Search load path with .so extension
- Search classloader resources with .rb and .so extensions
And this continues through a few other phases. The problem is that while the thread.rb file is available through the classloader (in jruby-complete.jar) we find the built-in thread.so library sooner, which causes us to skip loading the thread.rb where Thread.exclusive is defined. We don't want to move the classloader searching further up the chain since it's a little slow and most resources will be on command line anyway. But this does underscore the need for us to formalize the load process better than it exists currently, and possible always try JRuby's parent classloader for the resource so jruby-complete.jar works like you would expect. Marking for 1.2.