From: Shyouhei Urabe Date: 2009-07-31T16:00:27+09:00 Subject: [ruby-dev:38971] [Bug #1848] Net::SSH hangs Bug #1848: Net::SSH hangs http://redmine.ruby-lang.org/issues/show/1848 起票者: Shyouhei Urabe ステータス: Open, 優先度: Normal カテゴリ: core, Target version: Ruby 1.8.7 ruby -v: 1.8.7-p135 and later Revision r21165 以降、Net::SSHを使う場合(具体的にいうとCapistrano)で、スレッド切り替えがうまくいかないという報告を受けました # また聞きでもうしわけない https://capistrano.lighthouseapp.com/projects/8716/tickets/79 このへんが関係しているかも。してないかも。 再現方法 ["localhost","localhost"].map {|h| Thread.new{Net::SSH.start(h, "foo")}}.each {|t| t.join} proposed patch against 1.8.7 --- eval.c (revision 24335) +++ eval.c (working copy) @@ -11228,7 +11228,7 @@ break; } if ((th->status == THREAD_RUNNABLE || th == th_found) && th->stk_ptr) { - if (!next || next->priority < th->priority) { + if (!next || next->priority <= th->priority) { th_found->status = THREAD_RUNNABLE; th_found->wait_for = 0; ---------------------------------------- http://redmine.ruby-lang.org