Hi All,
We recently upgraded a rails based webapp to jruby 1.4.0 and are
seeing intermittent exceptions thrown around the activerecord
connection pool. After some narrowing down it appears that a timeout
on the connection pool monitor is happening however it’s happening in
the thread that was just woken up to receive a checked in connection
just as it attempts to call Thread.critical = true (in the wait method
on ConditionVariable in the MonitorMixin). This causes it to bail out
but a level up an ensure block in the mon_synchronize method that
causes the thread to try and release the monitor when it never re-took
it after waking up from waiting.
Exception:
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' 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:in
mon_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' /var/lib/tomcat6/webapps/ROOT/WEB-INF/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in
checkout’
/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:in
retrieve_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:in
connection’
If we replace monitor.rb in jruby-complete-1.4.0.jar with the one from
1.3.1 the problem goes away, that appears to be due to 1.3.1
containing a version of monitor.rb that was implemented using a mutex
instead
(remove use of TimeoutError, since it was controversial on ruby-core · jruby/jruby@3750f3a · GitHub,
similar to the one that’s on the ruby trunk but never made it into
1.8). Is it possible to have certain unsafe modules/classes excluded
when a new tag of ruby is supported? Although I understand that it’s
hard to claim compatibility with a certain version of ruby if jruby is
running different code.
Cheers,
Lucas
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email