Project

General

Profile

Actions

Bug #1848

closed

Net::SSH hangs

Added by shyouhei (Shyouhei Urabe) over 14 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
1.8.7-p135 and later
[ruby-dev:38971]

Description

=begin
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;
    

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0