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.)
* 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.
Also, deprecate WithBalancerName (was experimental).
The decision of whether something may be removed is based on if it was marked experimental as of v1.0/GA or upon its introduction, in accordance with Documentation/versioning.md.
* internal: fix Dial_OneBackoffPerRetryGroup
Instead of mutating global variables, switches getMinConnectDeadline to a
dial option.
Fixes#2687.
* rename getMinConnectTimeoutFunc to minConnectTimeout, ditto dial opt
Possible settings of this environment variable:
- "hybrid" (default; removed after the 1.17 release): do not wait for handshake before considering a connection ready, but wait before considering successful.
- "on" (default after the 1.17 release): wait for handshake before considering a connection ready/successful.
- "off": do not wait for handshake before considering a connection ready/successful.
This setting will be completely removed after the 1.18 release, and "on" will be the only supported behavior.
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