Mutex problem - deadlock

Environment: Jruby 1.4, Rails 2.3.5, Java 6, Tomcat 6

When running the application, the server gets stuck on requests and does
not respond. No errors are thrown. There seems to be some sort of
deadlock.

After looking into the issue, I found the following post:
http://groups.google.com/group/appengine-jruby-commits/browse_thread/thread/6e6a18cc3289871f

Commenting out line lock.lock in file
actionpack-2.3.4/lib/action_controller/reloader.rb, method run on line
31 fixes the problem.

Is this a known issue? Are there any downsides to commenting out this
line.

Thanks,
Jas

This seems to happen only in development mode.
I fixed it by updating to jruby-rack 0.9.6 (from trunk)

On Fri, Mar 5, 2010 at 5:27 AM, Jas G. [email protected] wrote:

Commenting out line lock.lock in file


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Seems like this might be a good enough reason to push out a jruby-rack
release very soon…

On Fri, Mar 5, 2010 at 2:22 AM, Maarten M.
[email protected] wrote:

Thanks,


To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Do you have class reloading (in rails) turned on with config.threadsafe!
enabled?

-Justin

On Fri, Mar 5, 2010 at 11:30 AM, Jas G. [email protected]
wrote:

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

By class reloading I mean:

config.cache_classes = false

-Justin

On Fri, Mar 5, 2010 at 11:36 AM, Justin C. [email protected]
wrote:

This seems to happen only in development mode.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I have rack 1.0.1 (jruby gem), but it is still happening.

Maarten M. wrote:

This seems to happen only in development mode.
I fixed it by updating to jruby-rack 0.9.6 (from trunk)

No I mean jruby-rack the jar file, not the ruby gem.

On Fri, Mar 5, 2010 at 6:30 PM, Jas G. [email protected] wrote:

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi all,

Thank you for all your help. It was much appreciated!

I was finally able to resolve the issue by using newer version of
jruby-rack file (0.9.6).

Regards,
Jas

Where can I find the new version of jruby-rack jar file?

As for my application configurations:

If I run the application with these configurations:

config.threadsafe!
config.cache_classes = false

I get the following error:

11:34:10,020 ERROR [/ida2]: - Application Error
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/reloader.rb:31:in
lock': Mutex relocking by same thread (ThreadError) from /usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/reloader.rb:31:inrun’
from
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:108:in
call' from file:/usr/share/tomcat6/webapps/ida2/WEB-INF/lib/jruby-rack-0.9.5.jar!/rack/adapter/rails.rb:35:inserve_rails’
from
file:/usr/share/tomcat6/webapps/ida2/WEB-INF/lib/jruby-rack-0.9.5.jar!/rack/adapter/rails.rb:51:in
call' from file:/usr/share/tomcat6/webapps/ida2/WEB-INF/lib/jruby-rack-0.9.5.jar!/jruby/rack/rails.rb:148:incall’
from
file:/usr/share/tomcat6/webapps/ida2/WEB-INF/lib/jruby-rack-0.9.5.jar!/rack/handler/servlet.rb:18:in
`call’
from :1
…internal jruby stack elided…
from
Mutex.lock(/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/reloader.rb:31)
from
#Class:01x482c7179.run(/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:108)
from
ActionController::Dispatcher.call(file:/usr/share/tomcat6/webapps/ida2/WEB-INF/lib/jruby-rack-0.9.5.jar!/rack/adapter/rails.rb:35)
from
Rack::Adapter::Rails.serve_rails(file:/usr/share/tomcat6/webapps/ida2/WEB-INF/lib/jruby-rack-0.9.5.jar!/rack/adapter/rails.rb:51)
from
Rack::Adapter::Rails.call(file:/usr/share/tomcat6/webapps/ida2/WEB-INF/lib/jruby-rack-0.9.5.jar!/jruby/rack/rails.rb:148)
from
JRuby::Rack::RailsRequestSetup.call(file:/usr/share/tomcat6/webapps/ida2/WEB-INF/lib/jruby-rack-0.9.5.jar!/rack/handler/servlet.rb:18)
from Rack::Handler::Servlet.call(:1)
from (unknown).(unknown)(:1)

When I run the application with following configurations:

config.threadsafe!
config.cache_classes = true

I get NameErrors in views for the classes in lib directory. By adding a
require statement in view fixes those. I never had to do that before in
views.
Example error:

11:46:51,682 ERROR error: - uninitialized constant
IDA::Entity::PackageStatus - On line #127 of
app/views/admin/product/view_packages.rhtml

124:                 %>
125:             </td>
126:             <td align="center">
127:                 <%=
128:                     IDA::Entity::PackageStatus.get_by_name(
129:                         package.getStatus()).description
130:                 %>

app/views/admin/product/view_packages.rhtml:127:in 

_run_rhtml_app47views47admin47product47view_packages46rhtml' file:/usr/share/tomcat6/webapps/ida2/WEB-INF/lib/jruby-stdlib-1.4.0.jar!/META-INF/jruby.home/lib/ruby/site_ruby/shared/builtin/java/java.util.rb:21:incall’
file:/usr/share/tomcat6/webapps/ida2/WEB-INF/lib/jruby-stdlib-1.4.0.jar!/META-INF/jruby.home/lib/ruby/site_ruby/shared/builtin/java/java.util.rb:21:in
each' app/views/admin/product/view_packages.rhtml:83:in_run_rhtml_app47views47admin47product47view_packages46rhtml’
app/controllers/admin/product_controller.rb:255:in view_packages' file:/usr/share/tomcat6/webapps/ida2/WEB-INF/lib/jruby-rack-0.9.5.jar!/rack/adapter/rails.rb:35:inserve_rails’
file:/usr/share/tomcat6/webapps/ida2/WEB-INF/lib/jruby-rack-0.9.5.jar!/rack/adapter/rails.rb:51:in
call' file:/usr/share/tomcat6/webapps/ida2/WEB-INF/lib/jruby-rack-0.9.5.jar!/jruby/rack/rails.rb:148:incall’
file:/usr/share/tomcat6/webapps/ida2/WEB-INF/lib/jruby-rack-0.9.5.jar!/rack/handler/servlet.rb:18:in
`call’
:1

==================================================================

Hi,

I’m seeing this issue (Mutex lock) with the following configuration:

JRuby 1.4.0
Tomcat 6.0.26
Rails 2.3.4
Rack 1.0.1
Warbler 0.9.14

The application shows this behavior when running in development mode.
I’m using warbler to generate my war file, and deploying into Tomcat.
I’m not sure where to find the jruby-rack file, so far, I’m just relying
on the installed gems.

Any tips to debug this?

Thanks,
Kevin

Jas G. wrote:

Hi all,

Thank you for all your help. It was much appreciated!

I was finally able to resolve the issue by using newer version of
jruby-rack file (0.9.6).

Regards,
Jas

Hi Kevin,

jruby-rack jar file is in warbler gem lib directory. When using warbler
to create the war file, jruby-rack.jar file is placed in WEB-INF/lib
directory.

Try upgrading jruby-rack-0.9.5.jar to jruby-rack-0.9.6.jar. Hopefully it
will resolve the issue.

Regards,
Jas

Kevin T. wrote:

Hi,

I’m seeing this issue (Mutex lock) with the following configuration:

JRuby 1.4.0
Tomcat 6.0.26
Rails 2.3.4
Rack 1.0.1
Warbler 0.9.14

The application shows this behavior when running in development mode.
I’m using warbler to generate my war file, and deploying into Tomcat.
I’m not sure where to find the jruby-rack file, so far, I’m just relying
on the installed gems.

Any tips to debug this?

Thanks,
Kevin

Jas G. wrote:

Hi all,

Thank you for all your help. It was much appreciated!

I was finally able to resolve the issue by using newer version of
jruby-rack file (0.9.6).

Regards,
Jas

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs