Commit Graph

66 Commits

Author SHA1 Message Date
Zach Reyes 5e587344ee
xds: Add support for Custom LB Policies (#6224) 2023-05-08 21:29:36 -04:00
Easwar Swaminathan de11139ae6
clusterresolver: improve tests (#6188) 2023-04-26 09:50:03 -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
Fabian Holler 55dfae6e5b
resolver: document handling UpdateState errors by resolvers (#6002)
Extend the Godoc for resolver.ClientConn.UpdateState with a
description of how resolvers should handle returned errors.

The description is based on the explanation of dfawley in
https://github.com/grpc/grpc-go/issues/5048
2023-02-08 17:04:05 -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
Doug Fawley 778860e606
testing: update Go to 1.19 (#5717) 2022-10-17 15:04:34 -07:00
Easwar Swaminathan f14d611253
resolver: minor improvements to AddressMap (#5426) 2022-06-15 14:42:38 -07:00
Easwar Swaminathan a73725f42d
channelz: include channelz identifier in logs (#5192) 2022-02-23 07:30:06 -08:00
Doug Fawley f00baa6c3c
resolver: replace AddressMap.Range with Keys (#4891)
Co-authored-by: Menghan Li <menghanl@google.com>
2021-10-20 15:07:37 -07:00
Doug Fawley 36d87572db
attributes: add Equal method; resolver: add AddressMap and State.BalancerAttributes (#4855) 2021-10-15 10:39:56 -07:00
Easwar Swaminathan aaff9e7ab9
grpc: better RFC 3986 compliant target parsing (#4817) 2021-10-14 14:54:02 -07:00
Menghan Li ebfe3be62a
cluster_resolver: implement resource resolver to resolve EDS and DNS (#4531) 2021-07-12 16:42:02 -07:00
Zach Reyes 1c598a11a4
Move exponential backoff to DNS resolver from resolver.ClientConn (#4270) 2021-04-20 13:20:09 -04:00
Menghan Li 0e8f1cda01
manual resolver: delete GenerateAndRegisterManualResolver (#3960)
Tests are using WithResolver dial option.
2020-10-22 13:14:27 -07:00
Gaurav Gahlot d9063e7af3
standardized experimental warnings (#3917) 2020-10-02 09:11:08 -07:00
Doug Fawley eb827fbfd8
grpclb, dns: pass balancer addresses via resolver.State (#3614) 2020-05-26 15:24:52 -07:00
Doug Fawley 27fd7d000e
balancer/resolver: remove temporary backward-compatibility type aliases (#3309) 2020-01-22 08:59:42 -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 4717e3b570
resolver: add deprecation note to AddressType and its values (#3156) 2019-11-08 10:38:45 -08:00
Doug Fawley f691f3524e
resolver: re-add dns and passthrough packages as references to internal versions (#3162) 2019-11-08 09:53:51 -08:00
Doug Fawley 0aa47d32da
resolver: introduce attributes package and use it for Address and State (#3151) 2019-11-06 16:53:23 -08:00
Easwar Swaminathan 88bf070301
resolver: Add new fields to resolver.BuildOption struct to support dialing a remote name resolver (#3098)
These fields will be used by resolver implementations which need to talk
to a remote name resolver.
2019-11-04 08:41:14 -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
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
Doug Fawley d40a995895
balancer/resolver: add loadBalancingConfig and pre-parsing support (#2732) 2019-05-30 09:12:58 -07:00
lyuxuan 4748a040c8
balancer: provide parsed target through BuildOptions (#2803) 2019-05-09 13:27:41 -07:00
Easwar Swaminathan 5ed5cbab96 dns: rate limit DNS resolution requests (#2760) 2019-05-02 10:23:30 -07:00
Doug Fawley 3910b873d3
bar: add ability to update resolver state atomically and pass directly to the balancer (#2693) 2019-03-22 10:48:55 -07:00
lyuxuan 2098091c81
dns: prefixing txt record lookup with "_grpc_config." (#2691) 2019-03-14 13:40:48 -07:00
shaun e9c1ac35ec fix: typos (#2591) 2019-01-23 09:59:48 -08:00
Doug Fawley 04ea82009c
cleanup: replace "x/net/context" import with "context" (#2439) 2018-11-12 13:30:41 -08:00
Doug Fawley 59a2cfbdf9
Remove support for Go1.6-1.8 (#2428) 2018-11-01 15:43:42 -07:00
☃ Elliot Shepherd ebea9b5bbc resolver/dns: support custom dns authority (#2265) 2018-09-25 10:45:03 -07:00
dfawley 911d69081b
Make all error strings use lowercased first letter per Go style (#2286) 2018-09-04 14:09:49 -07:00
Menghan Li c8fcd323ef
resolver: document that SetDefaultScheme should be called at init time (#2217)
fixes #2216
2018-07-16 11:19:04 -07:00
lyuxuan ce6ee6b031
dns resolver: exponential retry when getting empty address list (#2201) 2018-07-13 13:05:31 -07:00
dfawley 0c16dc1c74
resolver/dns: error if target ends with a colon instead of assuming the default port (#2150)
Technically this is a behavior change, but any usage of "host:" or ":" should be considered invalid, since dialing a target with a trailing ":" attempts to dial port zero, which is never valid (and we always used to pass the target directly to `net.Dial`).

In https://github.com/grpc/grpc/pull/15618, the target format will be defined as: `host[:port]` -- not: `host[:[port]]`.  (This is potentially subject to change.)
2018-06-22 15:23:03 -07:00
Jean de Klerk 0e5a36b652
internal: move leakcheck to internal/ (#2129)
internal: move leakcheck to internal/
2018-06-07 16:57:56 -07:00
Jacob Hoffman-Andrews 2c5843ebfd DNS resolver: Throw an error for non-default DNS authority. (#2067) 2018-06-04 10:43:01 -07:00
dfawley bd7f82c7b1
internal/grpcrand: New package for concurrency-safe randoms (#2106) 2018-05-29 09:06:35 -07:00
lyuxuan 854695bef0
client: introduce WithDisableServiceConfig DialOption (#2010) 2018-05-08 10:28:26 -07:00
lyuxuan 07709e8a3d
dns resolver: create rand seed at init time (#2007) 2018-04-26 15:10:23 -07:00
Karsten Weiss 5d8897144f Remove unnecessary type conversions (unconvert) (#1995)
This fixes:
grpc/interop/test_utils.go:156:17: unnecessary conversion
interop/test_utils.go:201:17: unnecessary conversion
resolver/dns/dns_resolver.go:190:31: unnecessary conversion
transport/flowcontrol.go:36:47: unnecessary conversion
transport/flowcontrol.go:41:47: unnecessary conversion
transport/flowcontrol.go:42:47: unnecessary conversion
transport/flowcontrol.go:43:47: unnecessary conversion
transport/http2_client.go:788:16: unnecessary conversion
transport/http2_client.go:798:36: unnecessary conversion
transport/http2_client.go:809:28: unnecessary conversion
transport/http2_client.go:834:31: unnecessary conversion
transport/http2_client.go:839:30: unnecessary conversion
transport/http2_client.go:864:23: unnecessary conversion
transport/http2_server.go:513:16: unnecessary conversion
transport/http2_server.go:524:36: unnecessary conversion
transport/http2_server.go:534:28: unnecessary conversion
transport/http2_server.go:557:31: unnecessary conversion
transport/http2_server.go:562:30: unnecessary conversion
transport/http_util.go:350:31: unnecessary conversion
2018-04-16 10:18:17 -07:00
Karsten Weiss 35a2846daa Various simplifications (gosimple)
This fixes:
clientconn.go:948:3: should write m = cc.sc.Methods[method[:i+1]] instead of m, _ = cc.sc.Methods[method[:i+1]] (S1005)
encoding/proto/proto_test.go:43:5: should use !bytes.Equal(p.GetBody(), expectedBody) instead (S1004)
resolver/dns/dns_resolver.go:260:2: should merge variable declaration with assignment on next line (S1021)
resolver/dns/dns_resolver.go:344:2: should use 'return <expr>' instead of 'if <expr> { return <bool> }; return <bool>' (S1008)
2018-04-15 15:32:33 +02:00
Menghan Li c4a6e7589b documentation: mention Register functions should be call at init time (#1975) 2018-04-12 15:11:04 -07:00
Keegan Carruthers-Smith e8d9fec333 resolver/dns: Typo in lookupHost failure warning (#1981) 2018-04-10 10:35:41 -07:00
Gyuho Lee d354447dc6 resolver/manual: fix minor typo (#1960)
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-02 10:01:29 -07:00
Menghan Li f2620c3803
resolver: keep full unparsed target string if scheme in parsed target is not registered (#1943) 2018-03-27 13:58:27 -07:00