Commit Graph

9 Commits

Author SHA1 Message Date
Menghan Li 191cc8e37b
grpclb: filter out grpclb addresses if balancer in use is not grpclb (#2509) 2018-12-13 10:54:42 -08:00
Doug Fawley 04ea82009c
cleanup: replace "x/net/context" import with "context" (#2439) 2018-11-12 13:30:41 -08:00
Menghan Li 4dedfdc82c
credentials: support google default creds (#2315)
Google default creds is a combo of ALTS, TLS and OAuth2. The right set of creds will be picked to use based on environment.

This PR contains:
 - A new `creds.Bundle` type
   - changes to use it in ClientConn and transport
   - dial option to set the bundle for a ClientConn
   - balancer options and NewSubConnOption to set it for SubConn
 - Google default creds implementation by @cesarghali 
 - grpclb changes to use different creds mode for different servers
 - interop client changes for google default creds testing
2018-09-25 13:17:25 -07:00
Xiaoyi a3e99ebee0 grpclb: s/fmt.Errorf/errors.New/ (#2196)
`errors.New` is more preferable when there is nothing to format from go readability perspective.
2018-07-03 09:15:11 -07:00
Krzysztof Dryś 536e74e045 Don't log grpclb server ending connection as error (#2162)
Fixes https://github.com/grpc/grpc-go/issues/2161

I introduced `serverTerminatedConnectionErr `, because I wanted `callRemoteBalancer` to still returns error on a terminated connections. Its client, which is function `watchRemoteBalancer` can decide how to log this error.

When remote grpclb-server terminates the connection, don't log it as
error. Instead, log it as info.

It is natural for servers to terminate long lived grpc streaming
connections. Two sample reasons to do this are: load balancing and
deployment of a new version. Therefore client of grpclb-server shouldn't
recognise this situation as an error.
2018-06-19 14:54:40 -07:00
Menghan Li 692f13ae39
grpclb: backoff for RPC call if init handshake was unsucessful (#2077) 2018-06-14 14:31:41 -07:00
Carl Mastrangelo dc86fffc26
Normalize gRPC LB 2018-06-11 17:52:20 -07:00
Menghan Li 629f6bc5e5
grpclb: minor fixes on comments and tests (#2122)
* modify noimport.go panic message
* package level comments
* remove useless error check at grpclb_test.go:343
2018-06-05 13:52:07 -07:00
Carl Mastrangelo 4344c204c9 Split grpclb out of top level grpc package (#2107)
This PR splits out grpclb from grpc.  I have made the PR in several commits so you can see more clearly the steps that happened.

There are a few possibly contentious points that I would like to make clear up front:

* grpclb will no longer autoload as a load balancer.  I think this is okay, as service config is not widely (at all?) used, and I believe this is the only way to access it.
* `internal` is used more, as a way of having code shared between packages without exposing types
* ConnectivityStateEvaluator, as used by grpclb, is no longer thread safe.  I believe there is an outer mutex that guards access, but I want to point out this subtle change up here.

All but one tests pass with this, due to another cyclic dependency.  I can fix this, but it is a little more widely scoped (such as exposing grpc.server and grpc.errorDesc in the internal package).   This PR is a nearly-passing sample of that last step to get this working. 

PTAL @menghanl @dfawley
2018-06-05 09:54:12 -07:00