mitchellh/vagrant — pull request #543 by hedgehog (2011-11-01 04:31:46+00:00)
Title: ssh connections. closes GH issue #391, #455, etc.

Should fix the ssh connection refused error.
- Banner connection error handled.
- Vagrant bails when orphaned Vagrant ssh sessions are around
- Multiplexing SSH conecctions
- Establish remote shell session is responsive before proceeding
- Net::SSH and Net::Scp are removed
- Use Aruba/ChildProcess to manage sessions (no threading)
- tested on Ubuntu Lucid +chef-solo (0.10.4)
- Distribution config variable + others (no parsing ssh output)
TODO
- Confirm with other provisioners.
- Confirm on other distributions.

Likely addresses issues:
-----------------------
GH issue #391, GH issue #410, GH issue #424, GH issue #443, GH issue #455, GH issue #493

Possibly addresses/affects issues:
---------------------------------
GH issue #516, GH issue #353

Overview
--------
Essentially between 1%-2% of reloads psuedo-fail.
I say psuedo-fail in the sense of current behavior.
Specifically, now running `vagrant reload` after a 'banner exchange exit' will succeed.

I've run reload 100 times under 1.9.2 and 1.8.7. Results are below.
I've run provision 100 times under 1.9.2 and 1.8.7, with full success.

One thing to think about in the code review is auto-triggering a reload when
the banner exchange error occurs.
Otherwise I think less faultly up and reloading will have to wait bootstrapping
via a serial console.

Command
-------
rm up-reload-1.8.log; vagrant halt th_ci_runner_6; vagrant up th_ci_runner_6 2>&1|tee up-reload-1.8.log; for ((n=0;n<100;n++)); do time vagrant reload th_ci_runner_6 2>&1|tee -a up-reload-1.8.log; done

Results
-------
Total 101

success (DEBUG: Exiting) (count: 1.9.2 = 100, 1.8.7 = 99)
banner exchange failed (count: 1.9.2 = 1, 1.8.7 = 2)
orphan master control (count: 1.9.2 = 14, 1.8.7 = 5)

Attempt counts:

1 (count: 1.9.2 = 155, 1.8.7 = 161)
2 (count: 1.9.2 = 311, 1.8.7 = 317)
3 (count: 1.9.2 = 34, 1.8.7 = 17)
4 (count: 1.9.2 = 168, 1.8.7 = 167)
5 (count: 1.9.2 = 31, 1.8.7 = 32)
6 (count: 1.9.2 = 1, 1.8.7 = 96)
7 (count: 1.9.2 = 0, 1.8.7=)