From be6a5b36ffe02a7abd718b184a087b2e546db556 Mon Sep 17 00:00:00 2001 From: tpetkov Date: Wed, 17 Jun 2020 07:08:54 +0000 Subject: [PATCH 1/2] Fix false positive in grpc_is_epollexclusive_available on ESXi --- src/core/lib/iomgr/is_epollexclusive_available.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/core/lib/iomgr/is_epollexclusive_available.cc b/src/core/lib/iomgr/is_epollexclusive_available.cc index 8df6a66e6b3..10cdf32f6e0 100644 --- a/src/core/lib/iomgr/is_epollexclusive_available.cc +++ b/src/core/lib/iomgr/is_epollexclusive_available.cc @@ -93,6 +93,21 @@ bool grpc_is_epollexclusive_available(void) { close(evfd); return false; } + // Check that EPOLLEXCLUSIVE is supported at all. + ev.events = + static_cast(EPOLLET | EPOLLIN | EPOLLEXCLUSIVE); + if (epoll_ctl(fd, EPOLL_CTL_ADD, evfd, &ev) != 0) { + if (!logged_why_not) { + gpr_log(GPR_DEBUG, + "epoll_ctl with EPOLLEXCLUSIVE failed with error: " + "%d. Not using epollex polling engine.", + errno); + logged_why_not = true; + } + close(fd); + close(evfd); + return false; + } close(evfd); close(fd); return true; From 77e2827f3d70650182474624b4de22e053ac01f6 Mon Sep 17 00:00:00 2001 From: tpetkov Date: Thu, 18 Jun 2020 20:32:37 +0000 Subject: [PATCH 2/2] Run clang-format on is_epollexclusive_available.cc --- src/core/lib/iomgr/is_epollexclusive_available.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/lib/iomgr/is_epollexclusive_available.cc b/src/core/lib/iomgr/is_epollexclusive_available.cc index 10cdf32f6e0..abc901efbe0 100644 --- a/src/core/lib/iomgr/is_epollexclusive_available.cc +++ b/src/core/lib/iomgr/is_epollexclusive_available.cc @@ -94,8 +94,7 @@ bool grpc_is_epollexclusive_available(void) { return false; } // Check that EPOLLEXCLUSIVE is supported at all. - ev.events = - static_cast(EPOLLET | EPOLLIN | EPOLLEXCLUSIVE); + ev.events = static_cast(EPOLLET | EPOLLIN | EPOLLEXCLUSIVE); if (epoll_ctl(fd, EPOLL_CTL_ADD, evfd, &ev) != 0) { if (!logged_why_not) { gpr_log(GPR_DEBUG,