Use GRPC_ARG_MAX_RECONNECT_BACKOFF_MS instead of "grpc.testing.fixed_reconnect_backoff_ms" to restrict the backoff to 1s

PiperOrigin-RevId: 232522905
This commit is contained in:
A. Unique TensorFlower 2019-02-05 11:19:45 -08:00 committed by TensorFlower Gardener
parent 36e8b05115
commit dfcd531df0
2 changed files with 2 additions and 2 deletions

View File

@ -730,7 +730,7 @@ Status DebugGrpcChannel::Connect(const int64 timeout_micros) {
::grpc::ChannelArguments args; ::grpc::ChannelArguments args;
args.SetInt(GRPC_ARG_MAX_MESSAGE_LENGTH, std::numeric_limits<int32>::max()); args.SetInt(GRPC_ARG_MAX_MESSAGE_LENGTH, std::numeric_limits<int32>::max());
// Avoid problems where default reconnect backoff is too long (e.g., 20 s). // Avoid problems where default reconnect backoff is too long (e.g., 20 s).
args.SetInt("grpc.testing.fixed_reconnect_backoff_ms", 1000); args.SetInt(GRPC_ARG_MAX_RECONNECT_BACKOFF_MS, 1000);
channel_ = ::grpc::CreateCustomChannel( channel_ = ::grpc::CreateCustomChannel(
server_stream_addr_, ::grpc::InsecureChannelCredentials(), args); server_stream_addr_, ::grpc::InsecureChannelCredentials(), args);
if (!channel_->WaitForConnected( if (!channel_->WaitForConnected(

View File

@ -62,7 +62,7 @@ Status ValidateHostPortPair(const string& host_port) {
args.SetInt(GRPC_ARG_MAX_MESSAGE_LENGTH, std::numeric_limits<int32>::max()); args.SetInt(GRPC_ARG_MAX_MESSAGE_LENGTH, std::numeric_limits<int32>::max());
// NOTE(mrry): Some versions of gRPC use a 20-second minimum backoff // NOTE(mrry): Some versions of gRPC use a 20-second minimum backoff
// on connection failure, which makes our tests time out. // on connection failure, which makes our tests time out.
args.SetInt("grpc.testing.fixed_reconnect_backoff_ms", 1000); args.SetInt(GRPC_ARG_MAX_RECONNECT_BACKOFF_MS, 1000);
if (rpc_options != nullptr) { if (rpc_options != nullptr) {
if (rpc_options->compression_algorithm() == "deflate") { if (rpc_options->compression_algorithm() == "deflate") {
args.SetCompressionAlgorithm(GRPC_COMPRESS_DEFLATE); args.SetCompressionAlgorithm(GRPC_COMPRESS_DEFLATE);