38 Commits

Author SHA1 Message Date
d46a3655c4 Add leak goroutine checking to grpc/balancer tests (#1497) 2017-09-07 14:30:05 -07:00
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
e60698345e Fix context warnings from govet. (#1486)
Pre-req work for #1484
2017-08-29 11:04:15 -07:00
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
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
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
a5d184a8a1 Expose ConnectivityState of a ClientConn. (#1385) 2017-07-24 15:00:53 -07:00
ddbf6c46a6 autofix license notice 2017-06-08 14:42:19 +02:00
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
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
0df08a7a03 :authority should include port number (#1123) 2017-03-28 11:09:23 -07:00
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
4ad16bc34a Authority overwrite only works if TLS is not present 2017-02-13 10:25:06 -08:00
c7430a063e Only override :authority for insecure dials 2017-02-09 10:46:00 -08:00
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
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
4f404a1c98 fix a circular dependency in clientconn_test 2016-11-18 15:01:12 -08:00
c31bccc236 add FailOnNonTempDialError to control if gRPC should fail on non-temp dial error 2016-11-15 11:14:07 -08:00
df5d48b597 fix comments 2016-11-09 17:35:47 -08:00
947e436ef4 return non temporary connection error if dialer returns non temprary errors 2016-11-09 17:25:46 -08:00
f02984b7c6 Basic support of grpclb 2016-09-19 15:11:57 -07:00
979f41603b review fix 2016-09-12 10:35:11 -07:00
726462e0cc fix TestTLSServerNameOverwrite timeout error 2016-09-08 17:26:58 -07:00
74f7afb1f9 Move balancer initialization into a goroutine 2016-09-08 15:13:50 -07:00
a00cbfeab5 Overwrite authority if creds servername is specified 2016-09-06 11:23:30 -07:00
7873a050d4 fix the test 2016-08-24 10:46:06 -07:00
7eae19acb7 fix the issue 2016-08-23 19:23:04 -07:00
b38541aeb0 Implement DialContext to afford caller option of managing cancelation 2016-08-16 16:57:59 -04:00
6205cb25ab fix some bugs 2016-07-13 18:05:02 -07:00
d9c8fb446d Change errCredentialsMisuse to errCredentialsConflict and errTransportCredentialsMissing 2016-06-08 13:53:41 -07:00
6404c49192 Make TransportAuthenticator not embed Credentials 2016-06-06 16:24:46 -07:00
404e9b67de dial time out 2016-06-06 12:08:11 -07:00
9dc3da0633 make downErr for Balancer down closure 2016-05-25 11:28:45 -07:00
9cec19a4d4 make setDefault(...) non-member function 2016-04-18 13:15:27 -07:00
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
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
cb8841c36e move some tests from end2end.go to clientconn_test.go 2015-11-06 11:33:13 -08:00