Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

ActiveRecord Connection Pool mutex problem

#3498

When I'm running 10 concurrent threads I'm getting the following error intermittently:

current thread not owner

/home/jcoyne/jruby/current/lib/ruby/1.8/monitor.rb:278:in mon_check_owner'
/home/jcoyne/jruby/current/lib/ruby/1.8/monitor.rb:224:inmon_exit'
/home/jcoyne/jruby/current/lib/ruby/1.8/monitor.rb:242:in mon_synchronize'
/home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:incheckout'
/home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in connection'
/home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:inretrieve_connection'
/home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in retrieve_connection'
/home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:inconnection'
/home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_specification.rb:20:in connection'
/home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/associations/has_and_belongs_to_many_association.rb:98:inconstruct_sql'

Reported by Justin Coyne · November 20th, 2009 @ 05:46 PM

State: stale
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Justin Coyne
    Justin Coyne

    This stacktrace should be easier to read:

    current thread not owner
    /home/jcoyne/jruby/current/lib/ruby/1.8/monitor.rb:278:in mon_check_owner'
    /home/jcoyne/jruby/current/lib/ruby/1.8/monitor.rb:224:inmon_exit'
    /home/jcoyne/jruby/current/lib/ruby/1.8/monitor.rb:242:in mon_synchronize'
    /home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:incheckout'
    /home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in connection'
    /home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:inretrieve_connection'
    /home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in retrieve_connection'
    /home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:inconnection'
    /home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_specification.rb:20:in connection'
    /home/jcoyne/jruby/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/associations/has_and_belongs_to_many_association.rb:98:inconstruct_sql'
    

    November 20th, 2009 @ 05:47 PM

  2. James Drucza
    James Drucza

    We are also experiencing the same issue, also intermittently (but this is not necessarily surprising since it seems to be a threading related issue).
    Other details:
    rails 2.3.5
    jruby 1.4.0
    tomcat 6

    It occurs when explicitly calling SomeActiveRecordModel.connection where SomeActiveRecordModel is a model in our app that extends ActiveRecord.

    Stacktrace snippet:
    W, [2010-03-12T02:27:55.307000 #515 Make plugin generator consistent with gemplugins] WARN -- : file:/var/lib/tomcat6/webapps/ROOT/WEB-INF/lib/jruby-complete-1.4.0.jar!/META-INF/jruby.home/lib/ruby/1.8/monitor.rb:278:in mon_check_owner'<br/> file:/var/lib/tomcat6/webapps/ROOT/WEB-INF/lib/jruby-complete-1.4.0.jar!/META-INF/jruby.home/lib/ruby/1.8/monitor.rb:224:inmon_exit'
    file:/var/lib/tomcat6/webapps/ROOT/WEB-INF/lib/jruby-complete-1.4.0.jar!/META-INF/jruby.home/lib/ruby/1.8/monitor.rb:242:in mon_synchronize'<br/> /var/lib/tomcat6/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:incheckout' /var/lib/tomcat6/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in connection' /var/lib/tomcat6/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:inretrieve_connection' /var/lib/tomcat6/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in retrieve_connection' /var/lib/tomcat6/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:inconnection'

    March 12th, 2010 @ 06:33 AM

  3. Santiago Pastorino
    Santiago Pastorino
    • State changed from new to open
    • Importance changed from to

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

    February 2nd, 2011 @ 04:54 PM

  4. Santiago Pastorino
    Santiago Pastorino
    • State changed from open to stale

    February 2nd, 2011 @ 04:54 PM