On Fri, Jan 15, 2010 at 1:10 PM, oaw <[email protected]> wrote:
>
> I'm on JRuby 1.4.0 (JDK version 1.6.0_17). The following code hangs my JRuby
> on Rails app.
>
> require 'net/http'
> require 'timeout'
>
> begin
>   Timeout::timeout(5) do
>       res =
> Net::HTTP.get_response("http://localhost:8080/projects/1/email_approved";)
>       res.body
> rescue Exception => e
>       RAILS_DEFAULT_LOGGER.error e
>       RAILS_DEFAULT_LOGGER.error e.backtrace.join('\n\t')
> end
>
> Non-local URLs work; only local URLs hang. It works fine in MRI Ruby. I've
> tried to resolve this for days with no success. Googling around, I found
> that timeout.rb is not reliable in previous versions of JRuby, so I upgraded
> to JRuby 1.4.0 but I still have this problem.
>
> Could someone please help? It would be greatly appreciated. I am at a
> complete loss.

Does your HTTP request loop back around to the same application that
is executing the request? Perhaps your app is pinned on a small number
of runtimes the extra request is waiting to acquire one. You could try
sending a QUIT signal to the process to generate a thread dump to see
what might be waiting and where.

Does it hang forever? Timeout.timeout doesn't help? Does your
appserver allow user-created threads?

I gave you more questions than answers, but hopefully helps you narrow
down the problem.

/Nick

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

    http://xircles.codehaus.org/manage_email


Reply via email to