@@ -62,10 +62,15 @@ static grpc_core::Duration g_poll_interval =
6262static bool g_backup_polling_disabled;
6363
6464void grpc_client_channel_global_init_backup_polling () {
65+ #ifndef GRPC_DO_NOT_INSTANTIATE_POSIX_POLLER
6566 // Disable backup polling if EventEngine is used everywhere.
6667 g_backup_polling_disabled = grpc_core::IsEventEngineClientEnabled () &&
6768 grpc_core::IsEventEngineListenerEnabled () &&
6869 grpc_core::IsEventEngineDnsEnabled ();
70+ #else
71+ // EventEngine polling not supported, keep using the backup poller.
72+ g_backup_polling_disabled = false ;
73+ #endif
6974 if (g_backup_polling_disabled) {
7075 return ;
7176 }
@@ -155,11 +160,21 @@ static void g_poller_init_locked() {
155160 }
156161}
157162
163+ static bool g_can_poll_in_background () {
164+ #ifndef GRPC_DO_NOT_INSTANTIATE_POSIX_POLLER
165+ return grpc_iomgr_run_in_background ();
166+ #else
167+ // No iomgr "event_engines" (not to be confused with the new EventEngine)
168+ // are able to run in backgroung.
169+ return false ;
170+ #endif
171+ }
172+
158173void grpc_client_channel_start_backup_polling (
159174 grpc_pollset_set* interested_parties) {
160175 if (g_backup_polling_disabled ||
161176 g_poll_interval == grpc_core::Duration::Zero () ||
162- grpc_iomgr_run_in_background ()) {
177+ g_can_poll_in_background ()) {
163178 return ;
164179 }
165180 gpr_mu_lock (&g_poller_mu);
@@ -179,7 +194,7 @@ void grpc_client_channel_stop_backup_polling(
179194 grpc_pollset_set* interested_parties) {
180195 if (g_backup_polling_disabled ||
181196 g_poll_interval == grpc_core::Duration::Zero () ||
182- grpc_iomgr_run_in_background ()) {
197+ g_can_poll_in_background ()) {
183198 return ;
184199 }
185200 grpc_pollset_set_del_pollset (interested_parties, g_poller->pollset );
0 commit comments