From 19babd6801c5f28d2a56555bbef593a0573d458f Mon Sep 17 00:00:00 2001 From: Vignesh Babu Date: Mon, 3 Oct 2022 10:57:51 -0700 Subject: [PATCH] Fix bug in epoll1 poller (#31211) --- BUILD | 1 + CMakeLists.txt | 1 + build_autogenerated.yaml | 2 ++ src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h | 3 ++- 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/BUILD b/BUILD index 164fb8112f1..32e14fa1e31 100644 --- a/BUILD +++ b/BUILD @@ -2683,6 +2683,7 @@ grpc_cc_library( "iomgr_port", "posix_event_engine_closure", "posix_event_engine_event_poller", + "posix_event_engine_internal_errqueue", "posix_event_engine_lockfree_event", "posix_event_engine_wakeup_fd_posix", "posix_event_engine_wakeup_fd_posix_default", diff --git a/CMakeLists.txt b/CMakeLists.txt index cfdfd59d266..31e42a29f65 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9497,6 +9497,7 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc src/core/lib/event_engine/posix_engine/ev_poll_posix.cc src/core/lib/event_engine/posix_engine/event_poller_posix_default.cc + src/core/lib/event_engine/posix_engine/internal_errqueue.cc src/core/lib/event_engine/posix_engine/lockfree_event.cc src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.cc src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.cc diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index d174cab34e4..23557e517d8 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -5746,6 +5746,7 @@ targets: - src/core/lib/event_engine/posix_engine/ev_poll_posix.h - src/core/lib/event_engine/posix_engine/event_poller.h - src/core/lib/event_engine/posix_engine/event_poller_posix_default.h + - src/core/lib/event_engine/posix_engine/internal_errqueue.h - src/core/lib/event_engine/posix_engine/lockfree_event.h - src/core/lib/event_engine/posix_engine/posix_engine_closure.h - src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.h @@ -5757,6 +5758,7 @@ targets: - src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc - src/core/lib/event_engine/posix_engine/ev_poll_posix.cc - src/core/lib/event_engine/posix_engine/event_poller_posix_default.cc + - src/core/lib/event_engine/posix_engine/internal_errqueue.cc - src/core/lib/event_engine/posix_engine/lockfree_event.cc - src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.cc - src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.cc diff --git a/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h b/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h index f3a9268a8ec..6a33b8a117a 100644 --- a/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h +++ b/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h @@ -30,6 +30,7 @@ #include "src/core/lib/event_engine/poller.h" #include "src/core/lib/event_engine/posix_engine/event_poller.h" +#include "src/core/lib/event_engine/posix_engine/internal_errqueue.h" #include "src/core/lib/event_engine/posix_engine/wakeup_fd_posix.h" #include "src/core/lib/iomgr/port.h" @@ -57,7 +58,7 @@ class Epoll1Poller : public PosixEventPoller { void Kick() override; Scheduler* GetScheduler() { return scheduler_; } void Shutdown() override; - bool CanTrackErrors() const override { return true; } + bool CanTrackErrors() const override { return KernelSupportsErrqueue(); } ~Epoll1Poller() override; private: