~axwalk/juju-core/lp1303195-manual-ubuntuuser-bash

[r=jameinel],[bug=1308487] state/api: save the connection as the first addr

When we connect to the API, we eventually will try all addresses listed.
We also will always save the value that we managed to connect with. This
change addresses bug #1308487, which has us move the address we
successfully connected to as the first server and address we should try
next time.

This doesn't quite give us a priority, because if we ever fail this one,
we'll go back to the default sort order except for one entry. However, I
think it still helps.

In my testing, I had to bump up the DialAddressInterval all the way up
to 500ms before we really wouldn't try most of the addresses. This is
because the time here *includes* the TLS handshake (though not the Login
round trip).

I would be happy to see the value bumped up a bit, but I don't have a
solid feeling for what is a great value there.
But since we always move the successful connection to the front, we
can expect that even if we wait a while to fall back, that will be the
uncommon case, as whatever address succeeded in the past is the most
likely to succeed the next time.

https://codereview.appspot.com/88470043/
Filename Latest Rev Last Changed Committer Comment Size
..
deployer.go 2376.1.1 10 years ago Tim Penhey Move to use the juju/loggo branch from github. 5.4 KB Diff Download File
deployer_test.go 2624.1.1 10 years ago Dimiter Naydenov All tests pass 7.6 KB Diff Download File
export_test.go 2354.1.2 10 years ago Dimiter Naydenov Merged trunk; resolved conflicts 649 bytes Diff Download File
simple.go 2354.1.2 10 years ago Dimiter Naydenov Merged trunk; resolved conflicts 6.1 KB Diff Download File
simple_test.go 2617.1.2 10 years ago Roger Peppe all: use string certs 9.2 KB Diff Download File