Capistrano SSH weirdness (Timing issue?)

I’m experiencing a problem with Capistrano where commands over the SSH
connection are never executed. This happens randomly (it feels like it’s
timing related – more on that below.)

I’m pretty sure that my Capistrano setup is OK – capistrano-1.2.0 &
net-ssh-1.0.10

The setup works fine when I’m deploying to our production server over a
WAN (and has been in service for a few months now.) The problem I’m
having is with a new staging server that’s on a LAN (1-Gbit between my
workstation and the server).

I checked the sshd_config on both the production and staging server and
they are identical.

What’s happening is that the #send_request in
Net::SSH:Connection::Channel gets ‘pty-req’ and never seems to return
(and follow up with a ‘exec’ request.)

If I tweak on Capistrano::Command and change the sleep 0.01 in #process!
to something longer (e.g. sleep 1) the problem happens less frequently
(but it doesn’t go away.)

Surely someone else is using cap on a fast local network without any
problems.

-ch

Updated to OpenSSH_4.2p1, OpenSSL 0.9.7i 14 Oct 2005 and this problem
went away. Weird.

-ch