aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Yuchen Zeng <zyc@google.com>2017-10-18 11:47:10 -0700
committerGravatar Yuchen Zeng <zyc@google.com>2017-10-30 12:06:52 -0700
commitcbb9296b729a312ca9ea59ef53cf022994c31dff (patch)
tree8378073ab041eb0d05d4fbdc3cd6388740e6de3f
parent7fa814fbeb9599d9d921a705438d254cc1920781 (diff)
Change the default interval to 5 seconds
-rw-r--r--doc/environment_variables.md2
-rw-r--r--src/core/ext/filters/client_channel/backup_poller.cc2
-rw-r--r--test/cpp/end2end/async_end2end_test.cc7
-rw-r--r--test/cpp/end2end/end2end_test.cc7
4 files changed, 10 insertions, 8 deletions
diff --git a/doc/environment_variables.md b/doc/environment_variables.md
index 0163235d63..40af758f69 100644
--- a/doc/environment_variables.md
+++ b/doc/environment_variables.md
@@ -121,7 +121,7 @@ some configuration as environment variables that can be set.
- ares - a DNS resolver based around the c-ares library
* GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS
- Default: 500
+ Default: 5000
Declares the interval between two backup polls on client channels. These polls
are run in the timer thread so that gRPC can process connection failures while
there is no active polling thread. They help reconnect disconnected client
diff --git a/src/core/ext/filters/client_channel/backup_poller.cc b/src/core/ext/filters/client_channel/backup_poller.cc
index dc1f87bc6c..e717c4eb7e 100644
--- a/src/core/ext/filters/client_channel/backup_poller.cc
+++ b/src/core/ext/filters/client_channel/backup_poller.cc
@@ -31,7 +31,7 @@
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/completion_queue.h"
-#define DEFAULT_POLL_INTERVAL_MS 500
+#define DEFAULT_POLL_INTERVAL_MS 5000
typedef struct backup_poller {
grpc_timer polling_timer;
diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc
index f8ad4c333c..af3bdb25ac 100644
--- a/test/cpp/end2end/async_end2end_test.cc
+++ b/test/cpp/end2end/async_end2end_test.cc
@@ -461,6 +461,7 @@ TEST_P(AsyncEnd2endTest, ReconnectChannel) {
if (GetParam().inproc) {
return;
}
+ gpr_setenv("GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS", "200");
int poller_slowdown_factor = 1;
// It needs 2 pollset_works to reconnect the channel with polling engine
// "poll"
@@ -478,12 +479,12 @@ TEST_P(AsyncEnd2endTest, ReconnectChannel) {
while (cq_->Next(&ignored_tag, &ignored_ok))
;
BuildAndStartServer();
- // It needs more than kConnectivityCheckIntervalMsec time to reconnect the
- // channel.
+ // It needs more than GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS time to
+ // reconnect the channel.
gpr_sleep_until(gpr_time_add(
gpr_now(GPR_CLOCK_REALTIME),
gpr_time_from_millis(
- 600 * poller_slowdown_factor * grpc_test_slowdown_factor(),
+ 300 * poller_slowdown_factor * grpc_test_slowdown_factor(),
GPR_TIMESPAN)));
SendRpc(1);
}
diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc
index 2272c9945e..82ca39466e 100644
--- a/test/cpp/end2end/end2end_test.cc
+++ b/test/cpp/end2end/end2end_test.cc
@@ -706,6 +706,7 @@ TEST_P(End2endTest, ReconnectChannel) {
if (GetParam().inproc) {
return;
}
+ gpr_setenv("GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS", "200");
int poller_slowdown_factor = 1;
// It needs 2 pollset_works to reconnect the channel with polling engine
// "poll"
@@ -717,12 +718,12 @@ TEST_P(End2endTest, ReconnectChannel) {
ResetStub();
SendRpc(stub_.get(), 1, false);
RestartServer(std::shared_ptr<AuthMetadataProcessor>());
- // It needs more than kConnectivityCheckIntervalMsec time to reconnect the
- // channel.
+ // It needs more than GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS time to
+ // reconnect the channel.
gpr_sleep_until(gpr_time_add(
gpr_now(GPR_CLOCK_REALTIME),
gpr_time_from_millis(
- 600 * poller_slowdown_factor * grpc_test_slowdown_factor(),
+ 300 * poller_slowdown_factor * grpc_test_slowdown_factor(),
GPR_TIMESPAN)));
SendRpc(stub_.get(), 1, false);
}