Commit Graph

39 Commits

Author SHA1 Message Date
Mikhail Mazurskiy 379a2f676c
*: add missing colon to errorf messages to improve readability (#5911) 2023-01-17 16:11:47 -08:00
Easwar Swaminathan a73725f42d
channelz: include channelz identifier in logs (#5192) 2022-02-23 07:30:06 -08:00
赵延 c44f627fd1
cleanup: replace grpc.WithInsecure with insecure.NewCredentials (#5177) 2022-02-09 11:17:46 -08:00
Menghan Li bd0f88150d
grpclb: recover after receiving an empty server list (#4879) 2021-10-20 10:52:03 -07:00
Easwar Swaminathan 6c56e211a0
grpclb: add `target_field` to service config (#4847) 2021-10-11 14:55:12 -07:00
Easwar Swaminathan 9dfe677337
balancer: Add UpdateAddresses() to balancer.ClientConn interface (#4215) 2021-02-25 15:48:39 -08:00
Menghan Li 78864797b8
balancer: set RPC metadata in address attributes, instead of Metadata field (#4041)
This metadata will be sent with all RPCs on the created SubConn
2020-11-18 17:12:51 -08:00
Menghan Li d6f8e6fbaf
grpclb: send custom user-agent (#4011) 2020-11-09 14:08:58 -08:00
Garrett Gutierrez 506b773066
Implemented component logging (#3617) 2020-06-26 12:04:47 -07:00
Doug Fawley 4eb418e5b2
balancer: move Balancer and Picker to V2; delete legacy API (#3431) 2020-04-28 14:52:49 -07:00
Menghan Li 7cb4db26f1
internal: update grpc_lb_v1 proto (#3499) 2020-04-06 10:09:23 -07:00
James Xu 508cf42036
cleanup: fix typo in grpclib_remote_balancer.go (#3486) 2020-04-01 21:19:11 -07:00
Doug Fawley 597699c0ef
grpclb: support explicit fallback signal (#3351) 2020-02-05 10:16:25 -08:00
Doug Fawley cd74fa23ea
internal: remove withResolverBuilder and use WithResolvers instead (#3321) 2020-01-15 08:54:42 -08:00
Doug Fawley 085c980048
grpclb: do not send redundant empty load reports to remote LB (#3249)
Small refactor of tests:

- Add a channel to remoteBalancer on which to send received stats messages
- Change runAndGetStats to runAndCheckStats to allow for faster successful test
  runs (no longer need to sleep for one whole second per test).
- Remove redundant leak check from runAndCheckStats, otherwise excess load
  report messages not read from the channel will result in an infinite loop.
- Add String method to rpcStats to avoid data race between merging and printing.
2019-12-12 14:10:47 -08:00
Doug Fawley 2cb07fcd90
resolver: rename Option to Options, leaving type aliases for now (#3175) 2019-11-12 15:23:46 -08:00
Menghan Li 459a38a0e3
grpclb: enter fallback if no balancer addresses are available (#3119)
This is necessary because there's another way to select grpclb (by specifying grpclb in service config's balancing policy field). So it's possible that grpclb is picked, but resolver doesn't have any balancer addresses.

When an update without balancer address is received, grpclb closes the underlying ClientConn to remote balancer, and enters fallback mode.

Note that grpclb waits until the ClientConn and the RPC goroutines are actually closed to do the fallback work. This can avoid race caused by async close.
2019-10-31 09:43:18 -07:00
Menghan Li 5e3ef93a5f
grpclb: avoid use of reflect.DeepEqual on proto.Message types (#3101) 2019-10-17 12:55:08 -07:00
Ning Xie c0122323a5 fix typo for grpclb token key (#3094) 2019-10-14 08:57:17 -07:00
Menghan Li a975db9349
grpclb: enable keepalive (#2918)
So grpclb client will reconnect when the connection is down (e.g. proxy
drops the server side connection but keeps the client side).
2019-07-22 12:44:59 -07:00
Menghan Li 08d23162a9
grpclb: recreate SubConns when switching fallback (#2899)
With pickfirst, the same SubConn is reused, only addresses are updated.
But backends and fallbacks may need different credentials. This change
force-removes all SubConns when switching fallback.
2019-07-10 13:56:55 -07:00
Menghan Li 532a0b98cb
only force update picker when cache is used (sub-balancer is round-robin) (#2843) 2019-06-03 10:43:53 -07:00
Menghan Li 3f98697f44
grpclb: handle service config and switch to pickfirst (#2719) 2019-04-11 11:25:27 -07:00
Menghan Li 4745f6ae0d
grpclb: fallback after init (#2681)
regenerate picker when switching between fallback/non-fallback, because new SubConn state might not be updated for cached SubConns
2019-04-02 16:27:52 -07:00
Nathan Herring bcfa7b30ac Downgrade grpclb package info logs to V(2). (#2710)
Fixes #2709.
2019-03-22 10:11:37 -07:00
Menghan Li d7d977965e
grpclb: support pickfirst (#2652)
Use pickfirst as balancing policy for backends. It can only set at init time.
Does not support changing with service config now.
2019-03-19 10:17:31 -07:00
Menghan Li 69e99ca520
grpclb: keep drop index unless a new serverlist is received (#2631)
Keep the drop index from the previous picker when regenerating picker due to
subchannel state change. Only reset the drop index when picker is regenerated
because of a serverlist update.

fixes #2623
2019-03-11 10:09:16 -07:00
Menghan Li 40cb5618f4
dialOption: export WithContextDialer() (#2629)
fixes #2627
2019-02-25 15:22:10 -08:00
Can Guler 29a7ac4deb
client: deprecates FailFast & replaces its use by WaitForReady. 2018-12-13 15:15:11 -08:00
Menghan Li 53884fa7e6
grpclb: re-resolve when the stream to GRPCLB balancer fails (#2502) 2018-12-13 14:44:34 -08:00
Doug Fawley 04ea82009c
cleanup: replace "x/net/context" import with "context" (#2439) 2018-11-12 13:30:41 -08:00
Menghan Li 491af2b0a4
grpclb: downgrade error logs to warning (#2381)
Warning is more appropriate per: https://github.com/grpc/grpc-go/blob/master/Documentation/log_levels.md#warning
2018-10-17 14:44:02 -07: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
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
lyuxuan b28608a9db
channelz: move APIs to internal except channelz service (#2157) 2018-06-18 17:59:08 -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
apolcyn 10a4999db0
Add some debug info (#2136) 2018-06-11 10:38:41 -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