Chris Ochs created JRUBY-6469:
---------------------------------

             Summary: Rails caching triggers autoload
                 Key: JRUBY-6469
                 URL: https://jira.codehaus.org/browse/JRUBY-6469
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.6
         Environment: Rails 3.0.9
            Reporter: Chris Ochs


Rails cache implementation triggers something that results in Marshal.load 
getting unrecognized constants, and then trying to autoload, which causes a 
thread lock.  This results in memcache calls blocking.

The rails caching creates it's own Entry object it sticks the data in, then it 
marshal's that.  I'm wondering if that's the culprit here.  The way I read the 
jruby code, any classes not known by the main thread, will cause an autoload in 
the worker thread when it is accessed, resulting in a thread lock.

I'm testing that theory now, will see how it pans out.

java.lang.Thread.State: BLOCKED (on object monitor)
        at org.jruby.RubyModule$Autoload.getConstant(RubyModule.java:3582)
        - waiting to lock <0x00000005e24b0140> (a java.lang.Object)
        at org.jruby.RubyModule.getAutoloadConstant(RubyModule.java:3420)
        at org.jruby.RubyModule.resolveUndefConstant(RubyModule.java:2974)
        at org.jruby.RubyModule.getConstantAt(RubyModule.java:2852)
        at 
org.jruby.RubyModule.iterateConstantNoConstMissing(RubyModule.java:2918)
        at org.jruby.RubyModule.getConstantNoConstMissing(RubyModule.java:2907)
        at org.jruby.RubyModule.getConstant(RubyModule.java:2877)
        at org.jruby.RubyModule.getConstant(RubyModule.java:2873)
        at org.jruby.RubyModule.getConstant(RubyModule.java:2869)
        at org.jruby.Ruby.getClassFromPath(Ruby.java:2448)
        at 
org.jruby.runtime.marshal.MarshalStream.getPathFromClass(MarshalStream.java:226)
        at 
org.jruby.runtime.marshal.MarshalStream.dumpDefaultObjectHeader(MarshalStream.java:480)
        at 
org.jruby.runtime.marshal.MarshalStream.dumpDefaultObjectHeader(MarshalStream.java:474)
        at 
org.jruby.runtime.marshal.MarshalStream.writeObjectData(MarshalStream.java:299)
        at 
org.jruby.runtime.marshal.MarshalStream.writeDirectly(MarshalStream.java:206)
        at org.jruby.RubyClass$MarshalTuple.dump(RubyClass.java:1602)
        at org.jruby.RubyClass.smartDump(RubyClass.java:1680)
        at 
org.jruby.runtime.marshal.MarshalStream.writeAndRegister(MarshalStream.java:155)
        at 
org.jruby.runtime.marshal.MarshalStream.dumpObject(MarshalStream.java:109)
        at org.jruby.RubyMarshal.dumpToStream(RubyMarshal.java:166)
        at org.jruby.RubyMarshal.dump(RubyMarshal.java:101)
        at 
org.jruby.RubyMarshal$s$0$2$dump.call(RubyMarshal$s$0$2$dump.gen:65535)
        at 
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:211)
        at 
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:207)
        at 
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:167)
        at 
rubyjit.Dalli::Server#serialize_E1BD995B2EF4BDACE869870F8975CCC7871BC759.chained_0_rescue_1$RUBY$SYNTHETIC__file__(/home/tomcat/tomcat10/webapps/ROOT/WEB-INF/vendor/gems/dalli/lib/dalli/server.rb:266)


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to