Commit Graph

25 Commits (7b9009952610960085a4df4edea39f67d40d8733)

Author SHA1 Message Date
Yicheng Qin 27b9963959 client: always cancel in-flight request when do request
This fits the way for go1.5 to cancel request.
2015-08-25 09:04:58 -07:00
Xiang Li 6b23a8131f *: test gofmt with -s and fix reported issues 2015-08-21 18:52:16 -07:00
Yicheng Qin a1ef699aeb client: return context.DeadlineExceeded instead of ClusterError
This is done to match user expectation to see context.DeadlineExceeded
when it reaches deadline.
2015-08-11 10:18:38 -07:00
Yicheng Qin f4c29a5f55 client: support to set timeout for each request
Add HeaderTimeout field in Config, so users could set timeout for each request.
Before this, one hanged request may block the call for long time. After
this, if the network is good, the user could set short timeout and expect
that API call can attempt next available endpoint quickly.
2015-08-11 10:01:05 -07:00
Yicheng Qin 0ab16db728 client: Sync() pin the endpoint when member list doesn't change
This helps client to pin the same endpoint as long as cluster doesn't change.
2015-08-07 10:08:28 -07:00
Xiang Li b9c6b64d61 Merge pull request #3216 from yichengq/cancel-err
client: return context canceled error correctly
2015-08-06 15:04:49 -07:00
Yicheng Qin 78af793338 client: return context canceled error correctly
If the body is closed to stop watching, it will ignore the error from
reading body and return context error.

Before this PR, the cancel when watching always returns error `read tcp
127.0.0.1:57824: use of closed network connection`. After this PR, it
will return expected context canceled error.
2015-08-06 14:52:04 -07:00
Xiang Li b04bb3e0ea Merge pull request #3229 from xiang90/f_cerr
client: return context.Canceled error when user cancels the request
2015-08-06 14:41:19 -07:00
Yicheng Qin c53b3016ae client: add AutoSync function
AutoSync provides the way for client to syncing member list from
etcd cluster automatically.
2015-08-05 13:22:56 -07:00
Xiang Li f38187bbdb client: return context.Canceled error when user cancels the request 2015-08-05 09:52:30 -07:00
Xiang Li 5fa8652241 client: return cluster error if the etcd cluster is not avaliable
Add a new ClusterError type. It contians all encountered errors and
return ClusterNotAvailable as the error string.
2015-07-29 22:55:15 +08:00
Yicheng Qin ea2347a40f client: pin itself to an endpoint that given
1. When reset endpoints, client will choose a random endpoint to pin.
2. If the pinned endpoint is healthy, client will keep using it.
3. If the pinned endpoint becomes unhealthy, client will attempt other
endpoints and update its pin.
2015-07-27 13:36:53 -07:00
Yicheng Qin 7716bdf981 client: fix TestSimpleHTTPClientDoCancelContextResponseBodyClosed
This fixes the bug that the test may hang forever because RoundTrip is
blocked. fixes #2449
2015-06-16 11:29:54 -07:00
Xiang Li 15ac4f08f8 client: fix cancel watch
ioutil.ReadAll is a blocking call, we need to wait cancelation
during the call.
2015-06-05 15:40:43 -07:00
Alex Crawford d9ad6aa2a9 *: update to use IANA-assigned ports 2015-04-06 13:49:43 -07:00
Brian Waldon 25cf916a80 client: ensure Response closed on cancel 2015-02-28 10:45:21 -08:00
Brian Waldon b41d6bc416 client: set hard limit on redirect checks 2015-02-28 10:45:21 -08:00
Brian Waldon 99aa0e1fcc client: test httpClusterClient.reset failure cases 2015-02-28 10:45:21 -08:00
Brian Waldon cd777b2966 client: test httpClusterClient.Sync 2015-02-28 10:45:21 -08:00
Brian Waldon 83930ac113 client: test DefaultCheckRedirect 2015-02-28 10:45:21 -08:00
Brian Waldon 32bfcca5a8 client: test httpKeysAPI.Set 2015-02-28 10:45:20 -08:00
Brian Waldon 9378413283 client: exhaustive member-related testing 2015-02-28 10:38:47 -08:00
Brian Waldon b174732812 client: introduce Error type 2015-02-28 10:38:47 -08:00
Brian Waldon 9b334e07a6 client: allow caller to decide HTTP redirect policy 2015-02-28 10:38:46 -08:00
Brian Waldon 6d82472275 client: move http.go into client.go 2015-02-28 10:22:52 -08:00