2662
|
|
|
Andrew Wilkins |
9 years ago
|
|
|
2661
|
|
|
José Antonio Rey |
9 years ago
|
|
|
2660
|
|
|
Ian Booth |
9 years ago
|
|
|
2659
|
|
|
Ian Booth |
9 years ago
|
|
|
2658
|
|
|
Ian Booth |
9 years ago
|
|
|
2657
|
|
|
Vladislav Klyachin |
9 years ago
|
|
|
2656
|
|
|
William Reade |
9 years ago
|
|
|
2655
|
|
|
Dimiter Naydenov |
9 years ago
|
|
|
2654
|
|
|
Andrew Wilkins |
9 years ago
|
|
|
2653
|
|
|
Roger Peppe |
9 years ago
|
|
|
2652
|
|
|
Roger Peppe |
9 years ago
|
|
|
2651
|
|
|
Roger Peppe |
9 years ago
|
|
|
2650
|
|
[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/
|
John Arbash Meinel |
9 years ago
|
|
|
2649
|
|
|
Dimiter Naydenov |
9 years ago
|
|
|
2648
|
|
[r=dimitern] errors: Improve tests, unify interfaces, wrapping
The errors package is refactored so that for all errors defined there are 3 functions with consistent names: * Is<type>(error) bool Returns true if the error satifies <type> (i.e. it was created with one of the two constructors below for <type>. * New<type>(error, string) error Creates an error of <type> wrapping the given error and adding the prefix to the message. * <type>f(string, ...interface{}) error Creates an error of <type> with a message, formatted like fmt.Sprintf.
Dropped "Error" from type and function names (as they already are in the "errors" package). Moved utils.ErrorContextf in here, renaming it to Maskf. A new helper called Contextf is added, which works similarly to Maskf, but preserves the original error when wrapping (if it's one of the known types), so that the Is<type>() satifiers will work on the wrapped error as well.
Added automatic exhaustive testing for each error type in a way that makes it easier to add new types.
Few drive-by fixes made while fixing the rest of the code base to use the new function names.
I realize we should use errgo for such things, but we can easily change the errors package to use errgo internally later.
https://codereview.appspot.com/87560043/
R=rogpeppe
|
Dimiter Naydenov |
9 years ago
|
|
|
2647
|
|
|
John Arbash Meinel |
9 years ago
|
|
|
2646
|
|
|
John Arbash Meinel |
9 years ago
|
|
|
2645
|
|
|
John Arbash Meinel |
9 years ago
|
|
|
2644
|
|
|
Andrew Wilkins |
9 years ago
|
|
|
2643
|
|
|
Roger Peppe |
9 years ago
|
|
|