Skip to content

Commit cbb9296

Browse files
committed
Change the default interval to 5 seconds
1 parent 7fa814f commit cbb9296

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

doc/environment_variables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ some configuration as environment variables that can be set.
121121
- ares - a DNS resolver based around the c-ares library
122122

123123
* GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS
124-
Default: 500
124+
Default: 5000
125125
Declares the interval between two backup polls on client channels. These polls
126126
are run in the timer thread so that gRPC can process connection failures while
127127
there is no active polling thread. They help reconnect disconnected client

src/core/ext/filters/client_channel/backup_poller.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "src/core/lib/surface/channel.h"
3232
#include "src/core/lib/surface/completion_queue.h"
3333

34-
#define DEFAULT_POLL_INTERVAL_MS 500
34+
#define DEFAULT_POLL_INTERVAL_MS 5000
3535

3636
typedef struct backup_poller {
3737
grpc_timer polling_timer;

test/cpp/end2end/async_end2end_test.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,7 @@ TEST_P(AsyncEnd2endTest, ReconnectChannel) {
461461
if (GetParam().inproc) {
462462
return;
463463
}
464+
gpr_setenv("GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS", "200");
464465
int poller_slowdown_factor = 1;
465466
// It needs 2 pollset_works to reconnect the channel with polling engine
466467
// "poll"
@@ -478,12 +479,12 @@ TEST_P(AsyncEnd2endTest, ReconnectChannel) {
478479
while (cq_->Next(&ignored_tag, &ignored_ok))
479480
;
480481
BuildAndStartServer();
481-
// It needs more than kConnectivityCheckIntervalMsec time to reconnect the
482-
// channel.
482+
// It needs more than GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS time to
483+
// reconnect the channel.
483484
gpr_sleep_until(gpr_time_add(
484485
gpr_now(GPR_CLOCK_REALTIME),
485486
gpr_time_from_millis(
486-
600 * poller_slowdown_factor * grpc_test_slowdown_factor(),
487+
300 * poller_slowdown_factor * grpc_test_slowdown_factor(),
487488
GPR_TIMESPAN)));
488489
SendRpc(1);
489490
}

test/cpp/end2end/end2end_test.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,7 @@ TEST_P(End2endTest, ReconnectChannel) {
706706
if (GetParam().inproc) {
707707
return;
708708
}
709+
gpr_setenv("GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS", "200");
709710
int poller_slowdown_factor = 1;
710711
// It needs 2 pollset_works to reconnect the channel with polling engine
711712
// "poll"
@@ -717,12 +718,12 @@ TEST_P(End2endTest, ReconnectChannel) {
717718
ResetStub();
718719
SendRpc(stub_.get(), 1, false);
719720
RestartServer(std::shared_ptr<AuthMetadataProcessor>());
720-
// It needs more than kConnectivityCheckIntervalMsec time to reconnect the
721-
// channel.
721+
// It needs more than GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS time to
722+
// reconnect the channel.
722723
gpr_sleep_until(gpr_time_add(
723724
gpr_now(GPR_CLOCK_REALTIME),
724725
gpr_time_from_millis(
725-
600 * poller_slowdown_factor * grpc_test_slowdown_factor(),
726+
300 * poller_slowdown_factor * grpc_test_slowdown_factor(),
726727
GPR_TIMESPAN)));
727728
SendRpc(stub_.get(), 1, false);
728729
}

0 commit comments

Comments
 (0)