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:
parent
36e8b05115
commit
dfcd531df0
@ -730,7 +730,7 @@ Status DebugGrpcChannel::Connect(const int64 timeout_micros) {
|
||||
::grpc::ChannelArguments args;
|
||||
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).
|
||||
args.SetInt("grpc.testing.fixed_reconnect_backoff_ms", 1000);
|
||||
args.SetInt(GRPC_ARG_MAX_RECONNECT_BACKOFF_MS, 1000);
|
||||
channel_ = ::grpc::CreateCustomChannel(
|
||||
server_stream_addr_, ::grpc::InsecureChannelCredentials(), args);
|
||||
if (!channel_->WaitForConnected(
|
||||
|
@ -62,7 +62,7 @@ Status ValidateHostPortPair(const string& host_port) {
|
||||
args.SetInt(GRPC_ARG_MAX_MESSAGE_LENGTH, std::numeric_limits<int32>::max());
|
||||
// NOTE(mrry): Some versions of gRPC use a 20-second minimum backoff
|
||||
// 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->compression_algorithm() == "deflate") {
|
||||
args.SetCompressionAlgorithm(GRPC_COMPRESS_DEFLATE);
|
||||
|
Loading…
Reference in New Issue
Block a user