Ruby 1.8.6 has replaced the Thread classes with the fastthread  
implementation. Unfortunately there is a bug in the release of 1.8.6  
that has to do with threading that will hopefully be fixed in the  
next release.

        For now install the fastthread gem and  then somewhere in the code  
you need to do this:

require 'fastthread'


        Try that and see if you still get the deadlock, my hunch is that  
this will fix it.

Cheers-
-Ezra


On Apr 11, 2007, at 7:08 AM, Jamis Buck wrote:

>
> Hmmm, looks like a Ruby 1.8.6 thing. It works fine on 1.8.5, but I
> can duplicate it too with 1.8.6.
>
> I'll make some time this week to investigate this a bit.
>
> - Jamis
>
> On Apr 11, 2007, at 7:27 AM, rubdabadub wrote:
>
>>
>> Yes, The deadlock error. I am on OSX 10.4 and ruby 1.8.6 (2007-03-13
>> patchlevel 0) [powerpc-darwin8.9.0]
>> and Rails 1.2.3.
>>
>> I am running ruby darwin ports if thats says something ..
>>
>> Cheers
>>
>> On Apr 11, 3:21 pm, Jamis Buck <[EMAIL PROTECTED]> wrote:
>>> On Apr 11, 2007, at 5:10 AM, rubdabadub wrote:
>>>
>>>> FYI:
>>>
>>>> I still receive the rake error. SVN rev - 6512
>>>
>>> The deadlock when running rake, you mean? What ruby version are you
>>> using? What is your operating system?
>>>
>>> - Jamis
>>>
>>>
>>>
>>>> Cheers
>>>
>>>> On Mar 30, 9:40 pm, Jamis Buck <[EMAIL PROTECTED]> wrote:
>>>>> Ah! Brilliant, Doug. Thanks for the patch! That cleared the  
>>>>> problem
>>>>> right up.
>>>
>>>>> - Jamis
>>>
>>>>> On Mar 30, 2007, at 12:51 PM, Doug Barth wrote:
>>>
>>>>>> The problem here is that your signaling thread is signaling
>>>>>> before the
>>>>>> originating thread has had the chance to wait on the condition.
>>>>>> This
>>>>>> results in the wait hanging forever waiting for a signal. The
>>>>>> fix is
>>>>>> to synchronize the creation of the background thread as well.
>>>>>> Here's a
>>>>>> patch that fixes the issue. I have also removed the Thread.pass
>>>>>> calls
>>>>>> as they not needed.
>>>
>>>>>> Index: gateway.rb
>>>>>> ================================================================= 
>>>>>> =
>>>>>> =
>>>>>> --- gateway.rb  (revision 6494)
>>>>>> +++ gateway.rb  (working copy)
>>>>>> @@ -38,18 +38,18 @@
>>>>>>        mutex = Mutex.new
>>>>>>        waiter = ConditionVariable.new
>>>
>>>>>> -      @thread = Thread.new do
>>>>>> -        logger.trace "starting connection to gateway
>>>>>> `#{server.host}'" if logger
>>>>>> -        SSH.connect(server, @options) do |@session|
>>>>>> -          logger.trace "gateway connection established" if  
>>>>>> logger
>>>>>> -          Thread.pass
>>>>>> -          mutex.synchronize { waiter.signal }
>>>>>> -          @session.loop { [EMAIL PROTECTED] }
>>>>>> +      mutex.synchronize do
>>>>>> +        @thread = Thread.new do
>>>>>> +          logger.trace "starting connection to gateway
>>>>>> `#{server.host}'" if logger
>>>>>> +          SSH.connect(server, @options) do |@session|
>>>>>> +            logger.trace "gateway connection established" if
>>>>>> logger
>>>>>> +            mutex.synchronize { waiter.signal }
>>>>>> +            @session.loop do
>>>>>> +              [EMAIL PROTECTED]
>>>>>> +            end
>>>>>> +          end
>>>>>>          end
>>>>>> -      end
>>>
>>>>>> -      mutex.synchronize do
>>>>>> -        Thread.pass
>>>>>>          waiter.wait(mutex)
>>>>>>        end
>>>>>>      end
>>>
>>>>>> On Mar 30, 9:38 am, Jamis Buck <[EMAIL PROTECTED]> wrote:
>>>>>>> Yeah...I've not been able to figure that out. It only happens
>>>>>>> intermittently to me. If you go into test/gateway_test.rb and
>>>>>>> comment
>>>>>>> out the
>>>>>>> test_initialize_when_connect_lags_should_open_and_set_session_va 
>>>>>>> l
>>>>>>> ue
>>>>>>> test (lines 13-17), it should go away.
>>>
>>>>>>> Any threading/concurrency gurus around that would like to help
>>>>>>> explain what I'm doing wrong? It only seems to affect the tests;
>>>>>>> Capistrano itself hasn't seemed to be impacted by this.
>>>
>>>>>>> - Jamis
>>>
>>>>>>> P.S. Good to see some people starting to play with cap2!
>>>
>>>>>>> On Mar 30, 2007, at 8:29 AM, rubdabadub wrote:
>>>
>>>>>>>> Hi:
>>>
>>>>>>>> I am just wondering what does this mean.. I get when i run the
>>>>>>>> tests
>>>
>>>>>>>> ............................................................... 
>>>>>>>> .
>>>>>>>> ..
>>>>>>>> ..
>>>>>>>> ..
>>>>>>>> ...................................................deadlock
>>>>>>>> 0x14bc084: sleep:-  - ./test/cli/../../lib/capistrano/
>>>>>>>> gateway.rb:46
>>>>>>>> deadlock 0x31704: sleep:- (main) - ./test/cli/../../lib/
>>>>>>>> capistrano/
>>>>>>>> gateway.rb:53
>>>
>>>>>>>> Does it mean I am missing something or??
>>>
>>>>>>>> Thanks
>>
>>
>>>
>
>
> >

-- Ezra Zygmuntowicz 
-- Lead Rails Evangelist
-- [EMAIL PROTECTED]
-- Engine Yard, Serious Rails Hosting
-- (866) 518-YARD (9273)



--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to