diff options
author | Craig Tiller <ctiller@google.com> | 2016-04-05 16:06:06 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-04-05 16:06:06 -0700 |
commit | d08c6ae5aa1b74adde7f819e566ab0097b649987 (patch) | |
tree | b48d12cdd2c64530ccf9063bbf5b4e1bef9c412f /src/core/ext/client_config | |
parent | 978161549032df14c24b6409554d1af6f28b45cd (diff) | |
parent | aa4a7f526a22f0205ff4ac927df2b92fafd38f4a (diff) |
Merge github.com:grpc/grpc into optionalize_client_config
Diffstat (limited to 'src/core/ext/client_config')
-rw-r--r-- | src/core/ext/client_config/subchannel.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/core/ext/client_config/subchannel.c b/src/core/ext/client_config/subchannel.c index e6e3885e40..20cf245a5b 100644 --- a/src/core/ext/client_config/subchannel.c +++ b/src/core/ext/client_config/subchannel.c @@ -352,6 +352,25 @@ grpc_subchannel *grpc_subchannel_create(grpc_exec_ctx *exec_ctx, c->args->args[i].value.integer, c->args->args[i].value.integer); } + if (0 == + strcmp(c->args->args[i].key, GRPC_ARG_MAX_RECONNECT_BACKOFF_MS)) { + if (c->args->args[i].type == GRPC_ARG_INTEGER) { + if (c->args->args[i].value.integer >= 0) { + gpr_backoff_init( + &c->backoff_state, GRPC_SUBCHANNEL_RECONNECT_BACKOFF_MULTIPLIER, + GRPC_SUBCHANNEL_RECONNECT_JITTER, + GPR_MIN(c->args->args[i].value.integer, + GRPC_SUBCHANNEL_INITIAL_CONNECT_BACKOFF_SECONDS * 1000), + c->args->args[i].value.integer); + } else { + gpr_log(GPR_ERROR, GRPC_ARG_MAX_RECONNECT_BACKOFF_MS + " : must be non-negative"); + } + } else { + gpr_log(GPR_ERROR, + GRPC_ARG_MAX_RECONNECT_BACKOFF_MS " : must be an integer"); + } + } } } gpr_mu_init(&c->mu); |