Issue Details (XML | Word | Printable)

Key: JRUBY-3326
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Jari Bakken
Votes: 0
Watchers: 0
Operations

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

Thread.exclusive fails in jruby-complete.jar

Created: 23/Jan/09 03:40 PM   Updated: 05/Oct/09 02:30 PM
Return to search
Component/s: Core Classes/Modules
Affects Version/s: None
Fix Version/s: JRuby 1.x+

Time Tracking:
Not Specified

Environment:
jruby 1.1.7 (ruby 1.8.6 patchlevel 287) (2009-01-23 rev 6586) [x86_64-java]


 Description  « Hide

Thread.exclusive (and thus DRb) fails when using jruby-complete.jar outside my checkout directory: https://gist.github.com/7195b5f3ccccde25515a



Charles Oliver Nutter added a comment - 28/Jan/09 06:50 PM

Ok, I see the problem here. Currently, here's the rough order in which we search for libraries in response to a require call:

  1. Search for a "builtin" with .rb extension
  2. Search as a jar: or file: URL with .rb extension
  3. Search load path with .rb extension
  4. Search for a "builtin" with .so extension
  5. Search as a jar: or file: URL with .so extension
  6. Search load path with .so extension
  7. 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.


Charles Oliver Nutter made changes - 28/Jan/09 06:50 PM
Field Original Value New Value
Fix Version/s JRuby 1.2 [ 14757 ]
Thomas E Enebo made changes - 04/Feb/09 12:48 PM
Component/s Core Classes/Modules [ 12230 ]
Charles Oliver Nutter added a comment - 23/Feb/09 04:56 PM

I was unable to come up with a good non-invasive fix for this in 1.2 timeframe, so we're going to punt to 1.3. I think another round of cleanup for LoadService is in order, but this may simply be a case where no solution is perfect.


Charles Oliver Nutter made changes - 23/Feb/09 04:56 PM
Fix Version/s JRuby 1.2 [ 14757 ]
Fix Version/s JRuby 1.3 [ 15027 ]
Charles Oliver Nutter made changes - 30/Apr/09 05:16 PM
Fix Version/s JRuby 1.3RC1 [ 15027 ]
Fix Version/s JRuby 1.3 [ 15267 ]
Charles Oliver Nutter made changes - 19/May/09 05:25 PM
Fix Version/s JRuby 1.3 [ 15267 ]
Fix Version/s JRuby 1.4 [ 15285 ]
Thomas E Enebo made changes - 16/Jun/09 02:59 PM
Assignee Thomas E Enebo [ enebo ]
Charles Oliver Nutter added a comment - 05/Oct/09 02:30 PM

Still not sure the best way to fix this. The simplest one I can think of would be to move the remaining thread.rb stuff into Java so it loads all at once with Thread.exclusive defined...


Charles Oliver Nutter made changes - 05/Oct/09 02:30 PM
Fix Version/s JRuby 1.4 [ 15285 ]
Fix Version/s JRuby 1.x+ [ 13421 ]