Граф коммитов

14 Коммитов

Автор SHA1 Сообщение Дата
Gaurav Gahlot d9063e7af3
standardized experimental warnings (#3917) 2020-10-02 09:11:08 -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
shaun e9c1ac35ec fix: typos (#2591) 2019-01-23 09:59:48 -08:00
Menghan Li 24f3cca1ff
internal: move backoff to internal (#2141)
So other components such as grpclb can reuse the backoff implementation.
2018-06-13 16:07:37 -07:00
dfawley bd7f82c7b1
internal/grpcrand: New package for concurrency-safe randoms (#2106) 2018-05-29 09:06:35 -07:00
田欧 faebfcb7bf Remove single-entry var blocks (#1589) 2017-10-18 09:59:23 -07:00
田欧 a94a7ac054 add license for some files (#1296) 2017-06-12 18:10:06 -07:00
Keiji Yoshida 7f3c1cacae Removed the unused named return parameter of `BackoffConfig`'s `backoff` method. 2016-10-11 03:42:29 +09:00
Dmitri Shuralyov e8316072cd Fix remaining instances of gRPC spelling.
According to http://www.grpc.io/faq/, the project is called gRPC. It's
already referred by that name in most places, except a few instances
where it's still "GRPC". Fix those to have consistency.
2016-06-02 18:00:07 -07:00
iamqizhao 9cec19a4d4 make setDefault(...) non-member function 2016-04-18 13:15:27 -07:00
iamqizhao 75407c0f82 change backoff to pointer receiver 2016-04-18 12:12:19 -07:00
Stephen J Day 8ef1dcabab backoff: make DefaultBackoffConfig a concrete value
To enforce immutability of the `DefaultBackoffConfig`, we've made it a
concrete value. While fields can still be set directly on the value,
taking a copy will not incidentally pull a reference to the variable.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-04-18 11:33:39 -07:00
Stephen J Day 9ff38e9093 backoff: set default values on BackoffConfig
Because most of the fields on `BackoffConfig` are unexported, correctly
using the config requires copying from the default. This sets the
defaults appropriately and falls back to a default if MaxDelay is
negative or zero.

Tests are added to ensure that the backoff is set correctly in common
use cases.

Signedroff-by: Stephen J Day <stephen.day@docker.com>
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-04-15 16:12:47 -07:00
Stephen J Day 47b74a63a8 backoff: allow configuration of backoff strategy
The backoff function and parameters have been pulled up into an
interface `backoffStrategy`. The default parameters are now part of a
package variable `DefaultBackoffConfig`. The strategy is then plumbed
through `dialOptions`. As a result of this PR, the
maximum backoff delay can now be set using the `WithBackoffConfig` dial
option.

While the addition of strategy may seem premature, this allows one to
simply export `BackoffStrategy` and `WithBackoff` to allow arbirarily
configurable backoff strategies.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-04-07 20:17:57 -07:00