[EventEngine] Disable the backup poller if all EventEngine experiments are running

pull/37951/head
AJ Heller 4 months ago
parent da4fb493de
commit 8169b7489f
  1. 17
      src/core/client_channel/backup_poller.cc

@ -57,8 +57,19 @@ static backup_poller* g_poller = nullptr; // guarded by g_poller_mu
// treated as const.
static grpc_core::Duration g_poll_interval =
grpc_core::Duration::Milliseconds(DEFAULT_POLL_INTERVAL_MS);
// TODO(hork): delete the backup poller when EventEngine is rolled out
// everywhere.
static bool backup_polling_disabled;
void grpc_client_channel_global_init_backup_polling() {
// Disable backup polling if EventEngine is used everywhere.
backup_polling_disabled = grpc_core::IsEventEngineClientEnabled() &&
grpc_core::IsEventEngineListenerEnabled() &&
grpc_core::IsEventEngineDnsEnabled();
if (backup_polling_disabled) {
return;
}
gpr_mu_init(&g_poller_mu);
int32_t poll_interval_ms =
grpc_core::ConfigVars::Get().ClientChannelBackupPollIntervalMs();
@ -146,7 +157,8 @@ static void g_poller_init_locked() {
void grpc_client_channel_start_backup_polling(
grpc_pollset_set* interested_parties) {
if (g_poll_interval == grpc_core::Duration::Zero() ||
if (backup_polling_disabled ||
g_poll_interval == grpc_core::Duration::Zero() ||
grpc_iomgr_run_in_background()) {
return;
}
@ -165,7 +177,8 @@ void grpc_client_channel_start_backup_polling(
void grpc_client_channel_stop_backup_polling(
grpc_pollset_set* interested_parties) {
if (g_poll_interval == grpc_core::Duration::Zero() ||
if (backup_polling_disabled ||
g_poll_interval == grpc_core::Duration::Zero() ||
grpc_iomgr_run_in_background()) {
return;
}

Loading…
Cancel
Save