You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
ScriptingContainer with LocalContextScope.THREADSAFE share one instance of JRubyClassLoader with all runtimes. since each runtime loads it own set of jar files but they get shared by the shared JRubyClassLoader. for example each runtime can load its own version of bouncycastle jars which will result one classloader having all those BC jars loaded.
@joedaniels29 the above problem is when you have several jruby runtimes (or ScriptingContainers) inside one classloader. all those runtimes share a child classloader the JRubyClassloader. with this JRubyClassLoader requiring BC and all the other jars needs to be synchroinized.
having several webapps inside a servlet engine are nicely separated and can run different versions of jruby or BC, etc.
each runtime gets it own JRubyClassloader and with this each one has its own set of loaded jars
ensure one the same jar is loaded only once into the JRubyClassLoader which is not the case right now. with one runtime, the require does take care of it, but with several runtimes sharing the same JRubyClassLoader this needs extra work
@mkristian aah, get it now - thanks for the explanation. never realised the case but it makes sense.
hmm I would vote for the "easy" way 1. but I'm afraid to put it in 1.1.x stable. on the other hand sounds like this might be JRubyClassLoader's responsibility (or we could setup a custom class-loader in JRuby-Rack assuming we can change the JRubyClassLoader used in Ruby) - probably doable decently. let me know if you're not looking into it, I will (if I do not forget or someone ping-s me)
@mkristian thanks, as I quickly looked through jruby-rack I did not find how you'd like to proceed on 1)
... as the runtime has always its own JRubyClassLoader - feel the same - not worth looking (as its clearly not obvious) unless paid by the hour :)