I was a lone developer who was trying to deploy to our staging environment, but my capistrano setup would hang. no one else was having a problem. I traced the problem to a hanging ssh, so I wrote up a simple Net::SSH script to try to ssh to the machines:
Net::SSH.start 'web01-s6.stage', 'build' do |ssh
puts ssh.exec!('ls')
end
this was working totally fine. I was baffled. I then ran cap under rdebug and still noticed that it was hanging when connecting to all the machines. I then tried duplicating the multithreaded connect:
%w/ daemon01-s6.stage web01-s6.stage /.map do |s|
Thread.new s do |server|
connection = Net::SSH.start server, 'build', options
puts connection.exec!('ls')
end
end.each { |t| t.join }
hang! so, it was threads + Net::SSH that was causing my problem. I asked around and all the other developers were using ruby 1.8.7p72. I was at 1.8.7p160 (I upgrade a lot). so, I downgraded my ruby (good thing I still had the old one deactivated in macports) and huzzah! no more hangs! I can deploy again:
Comments