clientv3: don't hold client lock while dialing

Causes async reconnect to block while the client is dialing.

This was also causing problems with the Close error message, so
now Close() will return the last dial error (if any) instead of
clearing it out with a cancel().

Fixes #5416
This commit is contained in:
Anthony Romano
2016-06-02 10:54:01 -07:00
parent b3fee0abff
commit 5f5a203e27
4 changed files with 76 additions and 35 deletions

View File

@ -74,7 +74,7 @@ func TestTxnWriteFail(t *testing.T) {
dialTimeout := 5 * time.Second
select {
case <-time.After(2*dialTimeout + time.Second):
case <-time.After(dialTimeout + time.Second):
t.Fatalf("timed out waiting for txn to fail")
case <-donec:
// don't restart cluster until txn errors out