Граф коммитов

48 Коммитов

Автор SHA1 Сообщение Дата
mmukhi 207e2760fd
Fix test race: Atomically access minConnecTimout in testing environment. (#1897) 2018-03-07 10:36:17 -08:00
mmukhi 7c5299d71e
Fix flaky test: TestCloseConnectionWhenServerPrefaceNotReceived (#1870)
* Atomically update minConnectTimeout in test.

* Refactor the flaky test.

* Post review update

* mend
2018-03-02 13:39:55 -08:00
Menghan Li 37346e3181
Revert "Add WithResolverUserOptions for custom resolver build options" (#1839)
This reverts commit ff1be3fcc5.
2018-02-05 12:52:35 -08:00
mmukhi 65c901e458
Fix flakey test. (#1771) 2017-12-28 09:31:16 -08:00
mmukhi 6610f9a340
Fix test: Data race while resetting global var. (#1748) 2017-12-18 15:27:23 -08:00
mmukhi b8cf13ea06
Make sure all goroutines have ended before restoring global vars. (#1732) 2017-12-14 13:23:05 -08:00
Menghan Li ff1be3fcc5
Add WithResolverUserOptions for custom resolver build options (#1711) 2017-12-06 15:54:01 -08:00
mmukhi ddbb27e545
client: backoff before reconnecting if an HTTP2 server preface was not received (#1648) 2017-12-01 09:55:42 -08:00
Menghan Li 10873b30bf
Fix panics on balancer and resolver updates (#1684)
- NewAddress with empty list (addrConn with an empty address list)
 - NewServiceConfig to switch balancer before the first balancer is built
2017-11-22 13:59:20 -08:00
Menghan Li a353537ff5 Register and use default balancers and resolvers (#1551) 2017-10-19 11:32:06 -07:00
Menghan Li d46a3655c4 Add leak goroutine checking to grpc/balancer tests (#1497) 2017-09-07 14:30:05 -07:00
Menghan Li 8233e124e4 Add new Resolver and Balancer APIs (gRFC L9) (#1408)
- Add package balancer and resolver.
 - Change ClientConn internals to new APIs and adds a wrapper for v1 balancer.
2017-08-31 10:59:09 -07:00
dfawley e60698345e Fix context warnings from govet. (#1486)
Pre-req work for #1484
2017-08-29 11:04:15 -07:00
Menghan Li e81b5698fd Add and use connectivity package for states (#1430)
* Add and use connectivity package
* Mark cc state APIs as experimental
2017-08-09 10:31:12 -07:00
Andrew Lytvynov 4e56696c6c Fix a goroutine leak in DialContext (#1424)
A leak happens when DialContext times out before a balancer returns any
addresses or before a successful connection is established.

The loop in ClientConn.lbWatcher breaks and doneChan never gets closed.
2017-08-04 13:40:50 -07:00
Menghan Li b463cc3276 Call cancel on contexts in tests (#1412) 2017-08-02 10:43:35 -07:00
田欧 ca9e0c3458 Add testdata package and unify testdata to only one dir (#1297) 2017-07-25 10:24:45 -07:00
mmukhi a5d184a8a1 Expose ConnectivityState of a ClientConn. (#1385) 2017-07-24 15:00:53 -07:00
Jan Tattermusch ddbf6c46a6 autofix license notice 2017-06-08 14:42:19 +02:00
Tamir Duberstein 3773797869 Travis: add staticcheck (#1019)
Also only run golint and go vet in Go 1.8, and fix some vet failures.
2017-05-15 17:05:27 -07:00
MakMukhi bfa5dd27dc Client should update keepalive parameters upon receiving GoAway with … (#1169)
* Client should update keepalive parameters upon receiving GoAway with EnhanceYourCalm and debug data of too_many_pings.
2017-04-10 14:33:51 -07:00
Menghan Li 0df08a7a03 :authority should include port number (#1123) 2017-03-28 11:09:23 -07:00
dfawley c5a5dbc500 Don't return an error from dial if the balancer returns no initial servers (#1112)
This modifies the WithBlock behavior somewhat to block until there is at least
one valid connection.  Previously, each connection would be made serially until
all had completed successfully, with any errors returned to the caller.  Errors
are now only returned due to connecting to a backend if a balancer is not used,
or if there is an error starting the balancer itself.

Fixes #976
2017-03-21 11:35:53 -07:00
Chris Roche 4ad16bc34a Authority overwrite only works if TLS is not present 2017-02-13 10:25:06 -08:00
Chris Roche c7430a063e Only override :authority for insecure dials 2017-02-09 10:46:00 -08:00
Chris Roche 84bee50bda Add DialOption to overwrite :authority pseudo-header
The :authority pseudo-header for a gRPC Client defaults to the host
portion of the dialed target and can only be overwritten by providing a
TransportCredentials. However, there are cases where setting this header
independent of any tranport security is valid. In my particular case,
in order to leverage Envoy for request routing, the cluster/service name
must be provided in the :authority header. This may also be useful in a
testing context.

This patch adds a DialOption to overwrite the authority header,
even if TransportCredentials are provided (I'd imagine you'd only ever
need to specify one or the other).
2017-02-03 17:29:18 -08:00
Qi Zhao 09aecb094e Add the initial service config support (#1009)
* Add the initial service config support

* start scWatcher later

* remove timeoutCh

* address the comments

* deal with dial timeout

* defer cancel for the newly created context for correct lifetime management

* fix the defer order

* added other 2 missing cancels
2016-12-19 16:31:00 -08:00
Menghan Li 4f404a1c98 fix a circular dependency in clientconn_test 2016-11-18 15:01:12 -08:00
Menghan Li c31bccc236 add FailOnNonTempDialError to control if gRPC should fail on non-temp dial error 2016-11-15 11:14:07 -08:00
Menghan Li df5d48b597 fix comments 2016-11-09 17:35:47 -08:00
Menghan Li 947e436ef4 return non temporary connection error if dialer returns non temprary errors 2016-11-09 17:25:46 -08:00
iamqizhao f02984b7c6 Basic support of grpclb 2016-09-19 15:11:57 -07:00
Menghan Li 979f41603b review fix 2016-09-12 10:35:11 -07:00
Menghan Li 726462e0cc fix TestTLSServerNameOverwrite timeout error 2016-09-08 17:26:58 -07:00
Menghan Li 74f7afb1f9 Move balancer initialization into a goroutine 2016-09-08 15:13:50 -07:00
Menghan Li a00cbfeab5 Overwrite authority if creds servername is specified 2016-09-06 11:23:30 -07:00
iamqizhao 7873a050d4 fix the test 2016-08-24 10:46:06 -07:00
iamqizhao 7eae19acb7 fix the issue 2016-08-23 19:23:04 -07:00
Spencer Kimball b38541aeb0 Implement DialContext to afford caller option of managing cancelation 2016-08-16 16:57:59 -04:00
iamqizhao 6205cb25ab fix some bugs 2016-07-13 18:05:02 -07:00
Menghan Li d9c8fb446d Change errCredentialsMisuse to errCredentialsConflict and errTransportCredentialsMissing 2016-06-08 13:53:41 -07:00
Menghan Li 6404c49192 Make TransportAuthenticator not embed Credentials 2016-06-06 16:24:46 -07:00
iamqizhao 404e9b67de dial time out 2016-06-06 12:08:11 -07:00
iamqizhao 9dc3da0633 make downErr for Balancer down closure 2016-05-25 11:28:45 -07:00
iamqizhao 9cec19a4d4 make setDefault(...) non-member function 2016-04-18 13:15:27 -07:00
Stephen J Day 8ef1dcabab backoff: make DefaultBackoffConfig a concrete value
To enforce immutability of the `DefaultBackoffConfig`, we've made it a
concrete value. While fields can still be set directly on the value,
taking a copy will not incidentally pull a reference to the variable.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-04-18 11:33:39 -07:00
Stephen J Day 9ff38e9093 backoff: set default values on BackoffConfig
Because most of the fields on `BackoffConfig` are unexported, correctly
using the config requires copying from the default. This sets the
defaults appropriately and falls back to a default if MaxDelay is
negative or zero.

Tests are added to ensure that the backoff is set correctly in common
use cases.

Signedroff-by: Stephen J Day <stephen.day@docker.com>
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-04-15 16:12:47 -07:00
iamqizhao cb8841c36e move some tests from end2end.go to clientconn_test.go 2015-11-06 11:33:13 -08:00