Commit Graph

502 Commits

Author SHA1 Message Date
my4 2059c6e46c
grpc: report connectivity state changes on the ClientConn for Subscribers (#6437)
Co-authored-by: Easwar Swaminathan <easwars@google.com>
2023-08-08 11:13:07 -07:00
Doug Fawley b9356e3d26
client: fix race between connection error and subconn shutdown (#6494) 2023-08-03 11:03:58 -07:00
Easwar Swaminathan f1fc2ca350
clientconn: add channel ID to some idleness logs (#6459) 2023-07-20 17:28:49 -07:00
Zach Reyes 7aab9c05b7
stats: Add RPC event for blocking for a picker update (#6422) 2023-07-18 13:50:03 -04:00
Doug Fawley 02946a3f37
resolver: remove deprecated AddressType (#6451) 2023-07-17 13:29:21 -07:00
Easwar Swaminathan 8e9c8f8e71
grpc: do not use balancer attributes during address comparison (#6439) 2023-07-11 18:35:39 -07:00
Anirudh Ramachandra fc0aa4689c
client: encode the authority by default (#6428) 2023-07-10 14:48:27 -07:00
Gina Yeh 11feb0a9af
resolver: delete Target.Scheme and Target.Authority (#6363)
* Delete resolver.Target.Scheme and resolver.Target.Authority

* cleanup - wrap block comments @ 80 columns
2023-07-05 10:47:46 -07:00
Zach Reyes 3e8eca8088
Revert "client: encode the authority by default (#6318)" (#6365)
This reverts commit 68576b3c42.
2023-06-09 19:06:18 -04:00
Doug Fawley 6578ef7224
client: handle empty address lists correctly in addrConn.updateAddrs (#6354) 2023-06-07 08:37:11 -07:00
Anirudh Ramachandra 68576b3c42
client: encode the authority by default (#6318) 2023-06-06 08:36:01 -07:00
Doug Fawley 1f23f6c2e0
client: fix Connect to handle channel idleness properly (#6331) 2023-05-31 10:23:01 -07:00
Doug Fawley e9799e79db
client: support a 1:1 mapping with acbws and addrConns (#6302) 2023-05-23 09:48:08 -07:00
Easwar Swaminathan 9b7a947cdc
grpc: support channel idleness (#6263) 2023-05-22 12:42:45 -07:00
Doug Fawley ed3ceba605
balancer: make producer RPCs block until the SubConn is READY (#6236) 2023-05-02 10:09:23 -07:00
Easwar Swaminathan 8c70261b5c
grpc: ClientConn cleanup in prep for channel idleness (#6189) 2023-04-20 18:49:17 -07:00
Easwar Swaminathan 89ec9609a5
grpc: read the service config channel once instead of twice (#6186) 2023-04-11 14:51:15 -07:00
Sergey Matyukevich a1e657ce53
client: log last error on subchannel connectivity change (#6109) 2023-03-15 10:19:01 -07:00
Doug Fawley 6d612a3e67
resolver: update Resolver.Scheme() docstring to mention requirement of lowercase scheme names (#6014) 2023-02-15 08:51:43 -08:00
Zach Reyes 81534105ca
client: Add dial option to disable global dial options (#6016) 2023-02-13 21:13:32 -05:00
Zach Reyes ceb3f07190
client: Revert dialWithGlobalOption (#6012) 2023-02-08 17:02:17 -05:00
Zach Reyes 6a707eb1bb
client: add an option to disable global dial options (#5990) 2023-01-27 17:06:29 -05:00
Kyle J. Burda 3930549b38
resolver: replace resolver.Target.Endpoint field with Endpoint() method (#5852)
Fixes https://github.com/grpc/grpc-go/issues/5796
2023-01-24 12:03:56 -08:00
Mikhail Mazurskiy 379a2f676c
*: add missing colon to errorf messages to improve readability (#5911) 2023-01-17 16:11:47 -08:00
Arvind Bright 07ac97c355
transport: simplify httpClient by moving onGoAway func to onClose (#5885) 2022-12-21 15:44:31 -06:00
Easwar Swaminathan 68b388b26f
balancer: support injection of per-call metadata from LB policies (#5853) 2022-12-20 15:13:02 -08:00
Zach Reyes a9709c3f8c
Added logs for reasons causing connection and transport close (#5840) 2022-12-08 19:44:23 -05:00
Doug Fawley c91396d4e1
pickfirst: do not return initial subconn while connecting (#5825)
Fixes https://github.com/grpc/grpc-go/issues/5293
2022-11-30 08:57:17 -08:00
littlejian 0d6481fb85
target: replace parsedTarget.Scheme to parsedTarget.URL.Scheme (#5750) 2022-11-01 11:08:00 -07:00
Doug Fawley 9127159caf
client: synchronously verify server preface in newClientTransport (#5731) 2022-10-20 09:29:17 -07:00
Fu Wei 79ccdd8f8e
clientconn: go idle if conn closed after preface received (#5714) 2022-10-18 09:01:08 -07:00
Doug Fawley 778860e606
testing: update Go to 1.19 (#5717) 2022-10-17 15:04:34 -07:00
Zach Reyes a077b94683
Switched unlock to defer in newAddrConn (#5556) 2022-08-02 15:58:50 -04:00
Lidi Zheng 13b378bc45
internal: add global DialOptions and ServerOptions for all clients and servers (#5352) 2022-06-02 16:17:01 -07:00
Alexander Andreev 081c688437
client: fix hctx leakage in addrConn.createTransport (#5337) 2022-05-23 09:23:54 -07:00
Menghan Li 30b9d59a76
client/SubConn: do not recreate addrConn if UpdateAddresses is called with the same addresses (#5373) 2022-05-20 15:17:29 -07:00
Doug Fawley 799605c228
client: fix potential panic during RPC retries (#5323) 2022-05-04 10:06:12 -07:00
Easwar Swaminathan 0066bf69de
grpc: perform graceful switching of LB policies in the `ClientConn` by default (#5285) 2022-04-01 13:14:35 -07:00
Easwar Swaminathan 42cadc171d
test: cleanup balancer switching tests (#5271) 2022-03-30 12:58:41 -07:00
Easwar Swaminathan 597e5d1b1a
don't apply defaultSC upon receipt of invalid service config (#5257) 2022-03-22 08:50:50 -07:00
Easwar Swaminathan c4cabf78f4
grpc: handle invalid service configs by applying the default if available (#5238) 2022-03-16 12:02:56 -07:00
Easwar Swaminathan eead9a824c
grpc: delete deprecated API WithBalancerName() (#5232) 2022-03-10 13:15:11 -08:00
Easwar Swaminathan cf6d4d5ab7
grpc: document ClientConn fields (#5227) 2022-03-09 07:51:20 -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 cf8b64e2c5
internal: add log when service config is disabled (#4973) 2021-11-12 12:58:35 -08:00
Easwar Swaminathan 82d8af8bf0
balancer: add Authority field to balancer.BuildOptions (#4969) 2021-11-11 10:59:18 -08:00
Easwar Swaminathan dd767416a6
grpc: implement WithInsecure() using the insecure package (#4718) 2021-11-09 15:42:07 -08:00
Doug Fawley 2a312458e6
client: don't force passthrough as default resolver (#4890) 2021-10-20 14:01:46 -07:00
Easwar Swaminathan aaff9e7ab9
grpc: better RFC 3986 compliant target parsing (#4817) 2021-10-14 14:54:02 -07:00
Easwar Swaminathan 5bfc05fb0c
grpc: clarify the use of transport.ErrConnClosing from createTransport() (#4757) 2021-09-13 11:50:52 -07:00
Doug Fawley d25e31e741
client: fix case where GOAWAY would leak connections and memory (#4755) 2021-09-10 14:12:13 -07:00
Easwar Swaminathan 7f560ef4c5
grpc: close underlying transport when subConn is closed when in connecting state (#4751) 2021-09-10 14:08:26 -07:00
Doug Fawley 8ab16ef276
balancer: add ExitIdle optional interface (#4673) 2021-08-18 15:04:35 -07:00
Doug Fawley 997ce619eb
clientconn: do not automatically reconnect addrConns; go idle instead (#4613) 2021-08-10 13:22:34 -07:00
Doug Fawley dd589923e1
clientconn: stop automatically connecting to idle subchannels returned by picker (#4579) 2021-07-02 16:21:46 -07:00
Menghan Li 45549242f7
internal: fix deadlock during switch_balancer and NewSubConn() (#4536) 2021-06-11 13:14:09 -07:00
Doug Fawley b1f7648a9f
client: ensure LB policy is closed before closing resolver (#4478) 2021-05-21 15:15:58 -07:00
Doug Fawley c15291b0f5
client: initialize safe config selector when creating ClientConn (#4398) 2021-05-07 15:24:10 -07:00
Menghan Li 7276af6dd7
client: fix leaked addrConn struct when addresses are updated (#4347) 2021-04-22 10:45:24 -07:00
apolcyn c229922995
client: propagate connection error causes to RPC statuses (#4311) 2021-04-13 13:06:05 -07:00
Edmond 39a500abb9
support unix-abstract schema (#4079) 2020-12-22 08:56:49 -08:00
Doug Fawley 750abe8f95
resolver: allow config selector to return an RPC error (#4082) 2020-12-08 13:32:37 -08:00
Doug Fawley b88744b832
xds: add ConfigSelector to support RouteAction timeouts (#3991) 2020-11-17 13:22:28 -08:00
Garrett Gutierrez 90f1b3ee83
client: use "localhost:port" as authority if target is ":port" (#4017) 2020-11-12 13:52:55 -08:00
Menghan Li d6f8e6fbaf
grpclb: send custom user-agent (#4011) 2020-11-09 14:08:58 -08:00
Garrett Gutierrez 4be647f7f6
internal/resolver/unix: Implemented unix resolver. (#3890) 2020-10-16 11:52:54 -07:00
George Kechagias 7464f756ae
channelz: remove redundant case from AddTraceEvent and remove caps from severities (#3925)
Rename UNKNOWN and INFO severities removing caps to match that of Warning and Error severities.
Remove redundant case from AddTraceEvent switch-case.
2020-10-07 08:50:23 -07:00
Gaurav Gahlot d9063e7af3
standardized experimental warnings (#3917) 2020-10-02 09:11:08 -07:00
Garrett Gutierrez a5a36bd3f0
client: set auth header to localhost for unix target (#3730) 2020-07-21 14:07:03 -07:00
Sophos a86c873a73
cleanup: fix mention of healthcheck to health (#3731) 2020-07-09 13:09:50 -07:00
Aliaksandr Mianzhynski 4258d12073
service config: add default method config support (#3684) 2020-07-06 17:56:02 -07: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
Easwar Swaminathan 4c4cafbab7
internal/transport: Get rid of TargetInfo struct. (#3527) 2020-04-14 14:43:14 -07:00
sethp-nr b02de00073
client: option to surface connection errors to callers (#3430)
This commit allows blocking clients to receive a more informative error
message than "context deadline exceeded", which is especially helpful in
tracking down persistent client misconfiguration (such as an invalid TLS
certificate, an invalid server that's refusing connections, etc.)
2020-04-09 13:45:13 -07:00
Patrick Bogen e965f2a60b
client: add a WithNoProxy dialoption (#3411) 2020-03-26 15:29:40 -07:00
panguncle 9e4ff32c82
client: fix getResolver to use scheme param (#3437) 2020-03-12 13:41:38 -07:00
Garrett Gutierrez fff75ae40f
channelz: log on channelz trace events and trace on channelz relevant logs. (#3329)
channelz: log on channelz trace events and trace on channelz relevant logs. (#3329)
2020-02-14 10:11:26 -08:00
Doug Fawley 92dd426e0c
balancer/base: keep bad SubConns in TransientFailure until Ready (#3366) 2020-02-12 15:41:45 -08:00
Easwar Swaminathan e38032e927
internal: Move parseTarget function into internal package and export it. (#3368)
This will be used by RLS LB policy to validate targets specified in the
service config.
2020-02-11 17:51:29 -08:00
Doug Fawley 7afcfdd66b
client: add interface for ClientConn to be accepted by generated code (#3334) 2020-01-24 14:49:31 -08:00
Doug Fawley cd74fa23ea
internal: remove withResolverBuilder and use WithResolvers instead (#3321) 2020-01-15 08:54:42 -08:00
Doug Fawley 0083f6eefc
client: add WithResolvers options for specifying client-local resolvers (#3320) 2020-01-14 12:44:21 -08:00
Doug Fawley c35a580b0c
Revert "balancer: move Balancer and Picker to V2; delete legacy… (#3315)
This reverts commit 336cf8d761.
2020-01-13 13:12:55 -08:00
Doug Fawley 336cf8d761
balancer: move Balancer and Picker to V2; delete legacy API (#3301) 2020-01-10 13:44:48 -08:00
Doug Fawley dc49de8acd
balancer: add V2Picker, ClientConn.UpdateState, SubConnState.ConnectionError (#3186)
Also implement V2 versions of base.*, xds, pickfirst, grpclb, and round robin balancers.
2019-11-21 10:27:29 -08:00
Doug Fawley 2cb07fcd90
resolver: rename Option to Options, leaving type aliases for now (#3175) 2019-11-12 15:23:46 -08:00
Doug Fawley 51ac07fb67
vet: revise staticcheck strategy (#3152) 2019-11-08 14:46:57 -08:00
Doug Fawley c0909e91a5
resolver: move dns and passthrough to internal (#3116)
Nobody should directly need to reference these packages.

This is technically a breaking change. However:

- Package dns was exporting a NewBuilder method. This should never have been necessary to use, but if so, it can be replaced by importing the "grpc" package and then using resolver.Get("dns").

- Package passthrough was not exporting any symbols and there was never a need to even blank-import it.

After as much searching as possible, it appears nobody in the open source community is referencing either of these packages.
2019-10-22 13:01:54 -07:00
Easwar Swaminathan 7c8e60372e
Add more details in ClientConn GoDoc. (#3096)
The newly added lines are mostly stolen from existing Java and C-core
documentation.
2019-10-15 09:18:24 -07:00
Joe Betz 2e7984e2c0 clientconn: override authority with address's ServerName, if set (#3073) 2019-10-08 13:59:02 -07:00
Doug Fawley ed563a02ea
resolver: add State fields to support error handling (#2951) 2019-10-04 12:59:43 -07:00
Easwar Swaminathan 31911ed09e
client: add WithConnectParams to configure connection backoff and timeout (#2960)
* Implement missing pieces for connection backoff.

Spec can be found here:
https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md

Summary of changes:
* Added a new type (marked experimental), ConnectParams, which contains
  the knobs defined in the spec (except for minConnectTimeout).
* Added a new API (marked experimental), WithConnectParams() to return a
  DialOption to dial with the provided parameters.
* Added new fields to the implementation of the exponential backoff in
  internal/backoff which mirror the ones in ConnectParams.
* Marked existing APIs WithBackoffMaxDelay() and WithBackoffConfig() as
  deprecated.
* Added a default exponential backoff implementation, for easy use of
  internal callers.

Added a new backoff package which defines the backoff configuration
options, and is used by both the grpc package and the internal/backoff
package. This allows us to have all backoff related options in a
separate package.
2019-10-03 16:47:13 -07:00
yuxiaobo96 861d8e7992 internal: fix typos in comments (#3046) 2019-09-30 15:30:07 -07:00
Doug Fawley e351044388
clientconn: fix potential deadlock caused by ResetConnectBackoff (#3051) 2019-09-27 10:51:22 -07:00
Doug Fawley 977142214c
client: fix race between transport draining and new RPCs (#2919)
Before these fixes, it was possible to see errors on new RPCs after a
connection began draining, and before establishing a new connection.  There is
an inherent race between choosing a SubConn and attempting to creating a stream
on it.  We should be able to avoid application-visible RPC errors due to this
with transparent retry.  However, several bugs were preventing this from
working correctly:

1. Non-wait-for-ready RPCs were skipping transparent retry, though the retry
design calls for retrying them.

2. The transport closed itself (and would consequently error new RPCs) before
notifying the SubConn that it was draining.

3. The SubConn wasn't synchronously updating itself once it was notified about
the closing or draining state.

4. The SubConn would go into the TRANSIENT_FAILURE state instantaneously,
causing RPCs to fail instead of queue.
2019-07-22 16:07:55 -07:00
Doug Fawley 24b2fb8959
client: remove option to send RPCs before HTTP/2 handshake is completed (#2904) 2019-07-12 13:37:27 -07:00
Menghan Li 5caf962939
client: addrConn NewStream and health check cleanup (#2848) 2019-06-26 11:15:17 -07:00
Doug Fawley a1d4c283c6
client: update state earlier to prevent resetTransport calls from killing good transports (#2862) 2019-06-10 16:58:43 -07:00