From 077f627aef875c9079a62304279ca6c79da19141 Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Wed, 24 Mar 2021 11:21:05 -0700 Subject: [PATCH] Remove unused eventmanager_libuv code (#25796) --- BUILD | 23 ----- BUILD.gn | 2 - CMakeLists.txt | 38 -------- Makefile | 2 - build_autogenerated.yaml | 14 --- config.m4 | 2 - config.w32 | 2 - gRPC-C++.podspec | 2 - gRPC-Core.podspec | 3 - grpc.gemspec | 2 - grpc.gyp | 2 - package.xml | 2 - .../lib/iomgr/poller/eventmanager_interface.h | 35 -------- .../lib/iomgr/poller/eventmanager_libuv.cc | 88 ------------------ .../lib/iomgr/poller/eventmanager_libuv.h | 88 ------------------ src/python/grpcio/grpc_core_dependencies.py | 1 - test/core/iomgr/poller/BUILD | 42 --------- .../iomgr/poller/eventmanager_libuv_test.cc | 90 ------------------- tools/doxygen/Doxyfile.c++.internal | 2 - tools/doxygen/Doxyfile.core.internal | 2 - tools/run_tests/generated/tests.json | 24 ----- 21 files changed, 466 deletions(-) delete mode 100644 src/core/lib/iomgr/poller/eventmanager_interface.h delete mode 100644 src/core/lib/iomgr/poller/eventmanager_libuv.cc delete mode 100644 src/core/lib/iomgr/poller/eventmanager_libuv.h delete mode 100644 test/core/iomgr/poller/BUILD delete mode 100644 test/core/iomgr/poller/eventmanager_libuv_test.cc diff --git a/BUILD b/BUILD index 597b191037c..a322d6277e9 100644 --- a/BUILD +++ b/BUILD @@ -1060,7 +1060,6 @@ grpc_cc_library( public_hdrs = GRPC_PUBLIC_HDRS, deps = [ "dual_ref_counted", - "eventmanager_libuv", "gpr_base", "grpc_codegen", "grpc_trace", @@ -3605,25 +3604,3 @@ filegroup( ], visibility = ["//visibility:public"], ) - -# Base classes of EventManagerInterface -grpc_cc_library( - name = "eventmanager_interface", - hdrs = [ - "src/core/lib/iomgr/poller/eventmanager_interface.h", - ], -) - -# Libuv-based EventManager implementation -grpc_cc_library( - name = "eventmanager_libuv", - srcs = [ - "src/core/lib/iomgr/poller/eventmanager_libuv.cc", - ], - hdrs = [ - "src/core/lib/iomgr/poller/eventmanager_libuv.h", - ], - deps = [ - "gpr_base", - ], -) diff --git a/BUILD.gn b/BUILD.gn index 1d8f3404a47..d49cb355947 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -934,8 +934,6 @@ config("grpc_config") { "src/core/lib/iomgr/nameser.h", "src/core/lib/iomgr/parse_address.cc", "src/core/lib/iomgr/parse_address.h", - "src/core/lib/iomgr/poller/eventmanager_libuv.cc", - "src/core/lib/iomgr/poller/eventmanager_libuv.h", "src/core/lib/iomgr/polling_entity.cc", "src/core/lib/iomgr/polling_entity.h", "src/core/lib/iomgr/pollset.cc", diff --git a/CMakeLists.txt b/CMakeLists.txt index f463115ee6f..3c805aa71ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -841,7 +841,6 @@ if(gRPC_BUILD_TESTS) add_dependencies(buildtests_cxx end2end_test) add_dependencies(buildtests_cxx error_details_test) add_dependencies(buildtests_cxx evaluate_args_test) - add_dependencies(buildtests_cxx eventmanager_libuv_test) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_dependencies(buildtests_cxx examine_stack_test) endif() @@ -1837,7 +1836,6 @@ add_library(grpc src/core/lib/iomgr/load_file.cc src/core/lib/iomgr/lockfree_event.cc src/core/lib/iomgr/parse_address.cc - src/core/lib/iomgr/poller/eventmanager_libuv.cc src/core/lib/iomgr/polling_entity.cc src/core/lib/iomgr/pollset.cc src/core/lib/iomgr/pollset_custom.cc @@ -2464,7 +2462,6 @@ add_library(grpc_unsecure src/core/lib/iomgr/load_file.cc src/core/lib/iomgr/lockfree_event.cc src/core/lib/iomgr/parse_address.cc - src/core/lib/iomgr/poller/eventmanager_libuv.cc src/core/lib/iomgr/polling_entity.cc src/core/lib/iomgr/pollset.cc src/core/lib/iomgr/pollset_custom.cc @@ -10283,41 +10280,6 @@ target_link_libraries(evaluate_args_test ) -endif() -if(gRPC_BUILD_TESTS) - -add_executable(eventmanager_libuv_test - test/core/iomgr/poller/eventmanager_libuv_test.cc - third_party/googletest/googletest/src/gtest-all.cc - third_party/googletest/googlemock/src/gmock-all.cc -) - -target_include_directories(eventmanager_libuv_test - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} - ${_gRPC_RE2_INCLUDE_DIR} - ${_gRPC_SSL_INCLUDE_DIR} - ${_gRPC_UPB_GENERATED_DIR} - ${_gRPC_UPB_GRPC_GENERATED_DIR} - ${_gRPC_UPB_INCLUDE_DIR} - ${_gRPC_XXHASH_INCLUDE_DIR} - ${_gRPC_ZLIB_INCLUDE_DIR} - third_party/googletest/googletest/include - third_party/googletest/googletest - third_party/googletest/googlemock/include - third_party/googletest/googlemock - ${_gRPC_PROTO_GENS_DIR} -) - -target_link_libraries(eventmanager_libuv_test - ${_gRPC_PROTOBUF_LIBRARIES} - ${_gRPC_ALLTARGETS_LIBRARIES} - grpc_test_util -) - - endif() if(gRPC_BUILD_TESTS) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) diff --git a/Makefile b/Makefile index 8e7dd5fa9d3..cb798ded390 100644 --- a/Makefile +++ b/Makefile @@ -1408,7 +1408,6 @@ LIBGRPC_SRC = \ src/core/lib/iomgr/load_file.cc \ src/core/lib/iomgr/lockfree_event.cc \ src/core/lib/iomgr/parse_address.cc \ - src/core/lib/iomgr/poller/eventmanager_libuv.cc \ src/core/lib/iomgr/polling_entity.cc \ src/core/lib/iomgr/pollset.cc \ src/core/lib/iomgr/pollset_custom.cc \ @@ -1883,7 +1882,6 @@ LIBGRPC_UNSECURE_SRC = \ src/core/lib/iomgr/load_file.cc \ src/core/lib/iomgr/lockfree_event.cc \ src/core/lib/iomgr/parse_address.cc \ - src/core/lib/iomgr/poller/eventmanager_libuv.cc \ src/core/lib/iomgr/polling_entity.cc \ src/core/lib/iomgr/pollset.cc \ src/core/lib/iomgr/pollset_custom.cc \ diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index f1dfdaca646..60ac944153e 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -724,7 +724,6 @@ libs: - src/core/lib/iomgr/lockfree_event.h - src/core/lib/iomgr/nameser.h - src/core/lib/iomgr/parse_address.h - - src/core/lib/iomgr/poller/eventmanager_libuv.h - src/core/lib/iomgr/polling_entity.h - src/core/lib/iomgr/pollset.h - src/core/lib/iomgr/pollset_custom.h @@ -1250,7 +1249,6 @@ libs: - src/core/lib/iomgr/load_file.cc - src/core/lib/iomgr/lockfree_event.cc - src/core/lib/iomgr/parse_address.cc - - src/core/lib/iomgr/poller/eventmanager_libuv.cc - src/core/lib/iomgr/polling_entity.cc - src/core/lib/iomgr/pollset.cc - src/core/lib/iomgr/pollset_custom.cc @@ -1738,7 +1736,6 @@ libs: - src/core/lib/iomgr/lockfree_event.h - src/core/lib/iomgr/nameser.h - src/core/lib/iomgr/parse_address.h - - src/core/lib/iomgr/poller/eventmanager_libuv.h - src/core/lib/iomgr/polling_entity.h - src/core/lib/iomgr/pollset.h - src/core/lib/iomgr/pollset_custom.h @@ -1999,7 +1996,6 @@ libs: - src/core/lib/iomgr/load_file.cc - src/core/lib/iomgr/lockfree_event.cc - src/core/lib/iomgr/parse_address.cc - - src/core/lib/iomgr/poller/eventmanager_libuv.cc - src/core/lib/iomgr/polling_entity.cc - src/core/lib/iomgr/pollset.cc - src/core/lib/iomgr/pollset_custom.cc @@ -5037,16 +5033,6 @@ targets: - test/core/security/evaluate_args_test.cc deps: - grpc_test_util -- name: eventmanager_libuv_test - gtest: true - build: test - language: c++ - headers: [] - src: - - test/core/iomgr/poller/eventmanager_libuv_test.cc - deps: - - grpc_test_util - uses_polling: false - name: examine_stack_test gtest: true build: test diff --git a/config.m4 b/config.m4 index 157948314e6..f7c32f4bd3c 100644 --- a/config.m4 +++ b/config.m4 @@ -459,7 +459,6 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/iomgr/load_file.cc \ src/core/lib/iomgr/lockfree_event.cc \ src/core/lib/iomgr/parse_address.cc \ - src/core/lib/iomgr/poller/eventmanager_libuv.cc \ src/core/lib/iomgr/polling_entity.cc \ src/core/lib/iomgr/pollset.cc \ src/core/lib/iomgr/pollset_custom.cc \ @@ -1158,7 +1157,6 @@ if test "$PHP_GRPC" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/http) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/iomgr) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/iomgr/executor) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/iomgr/poller) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/json) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/matchers) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/profiling) diff --git a/config.w32 b/config.w32 index f2745a63d3f..a47d826efbc 100644 --- a/config.w32 +++ b/config.w32 @@ -425,7 +425,6 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\iomgr\\load_file.cc " + "src\\core\\lib\\iomgr\\lockfree_event.cc " + "src\\core\\lib\\iomgr\\parse_address.cc " + - "src\\core\\lib\\iomgr\\poller\\eventmanager_libuv.cc " + "src\\core\\lib\\iomgr\\polling_entity.cc " + "src\\core\\lib\\iomgr\\pollset.cc " + "src\\core\\lib\\iomgr\\pollset_custom.cc " + @@ -1258,7 +1257,6 @@ if (PHP_GRPC != "no") { FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\http"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\iomgr"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\iomgr\\executor"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\iomgr\\poller"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\json"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\matchers"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\profiling"); diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index fd6e4e99a26..dd3b9287456 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -583,7 +583,6 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/lockfree_event.h', 'src/core/lib/iomgr/nameser.h', 'src/core/lib/iomgr/parse_address.h', - 'src/core/lib/iomgr/poller/eventmanager_libuv.h', 'src/core/lib/iomgr/polling_entity.h', 'src/core/lib/iomgr/pollset.h', 'src/core/lib/iomgr/pollset_custom.h', @@ -1222,7 +1221,6 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/lockfree_event.h', 'src/core/lib/iomgr/nameser.h', 'src/core/lib/iomgr/parse_address.h', - 'src/core/lib/iomgr/poller/eventmanager_libuv.h', 'src/core/lib/iomgr/polling_entity.h', 'src/core/lib/iomgr/pollset.h', 'src/core/lib/iomgr/pollset_custom.h', diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 093876f901b..01ae73acad9 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -990,8 +990,6 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/nameser.h', 'src/core/lib/iomgr/parse_address.cc', 'src/core/lib/iomgr/parse_address.h', - 'src/core/lib/iomgr/poller/eventmanager_libuv.cc', - 'src/core/lib/iomgr/poller/eventmanager_libuv.h', 'src/core/lib/iomgr/polling_entity.cc', 'src/core/lib/iomgr/polling_entity.h', 'src/core/lib/iomgr/pollset.cc', @@ -1780,7 +1778,6 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/lockfree_event.h', 'src/core/lib/iomgr/nameser.h', 'src/core/lib/iomgr/parse_address.h', - 'src/core/lib/iomgr/poller/eventmanager_libuv.h', 'src/core/lib/iomgr/polling_entity.h', 'src/core/lib/iomgr/pollset.h', 'src/core/lib/iomgr/pollset_custom.h', diff --git a/grpc.gemspec b/grpc.gemspec index 51895f78719..77ccf46b66c 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -906,8 +906,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/iomgr/nameser.h ) s.files += %w( src/core/lib/iomgr/parse_address.cc ) s.files += %w( src/core/lib/iomgr/parse_address.h ) - s.files += %w( src/core/lib/iomgr/poller/eventmanager_libuv.cc ) - s.files += %w( src/core/lib/iomgr/poller/eventmanager_libuv.h ) s.files += %w( src/core/lib/iomgr/polling_entity.cc ) s.files += %w( src/core/lib/iomgr/polling_entity.h ) s.files += %w( src/core/lib/iomgr/pollset.cc ) diff --git a/grpc.gyp b/grpc.gyp index 479bf559fa5..d8736e6b309 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -818,7 +818,6 @@ 'src/core/lib/iomgr/load_file.cc', 'src/core/lib/iomgr/lockfree_event.cc', 'src/core/lib/iomgr/parse_address.cc', - 'src/core/lib/iomgr/poller/eventmanager_libuv.cc', 'src/core/lib/iomgr/polling_entity.cc', 'src/core/lib/iomgr/pollset.cc', 'src/core/lib/iomgr/pollset_custom.cc', @@ -1271,7 +1270,6 @@ 'src/core/lib/iomgr/load_file.cc', 'src/core/lib/iomgr/lockfree_event.cc', 'src/core/lib/iomgr/parse_address.cc', - 'src/core/lib/iomgr/poller/eventmanager_libuv.cc', 'src/core/lib/iomgr/polling_entity.cc', 'src/core/lib/iomgr/pollset.cc', 'src/core/lib/iomgr/pollset_custom.cc', diff --git a/package.xml b/package.xml index 40a7f31c875..12b038bc74c 100644 --- a/package.xml +++ b/package.xml @@ -886,8 +886,6 @@ - - diff --git a/src/core/lib/iomgr/poller/eventmanager_interface.h b/src/core/lib/iomgr/poller/eventmanager_interface.h deleted file mode 100644 index b4fbaeb7bbb..00000000000 --- a/src/core/lib/iomgr/poller/eventmanager_interface.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_INTERFACE_H -#define GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_INTERFACE_H - -namespace grpc { -namespace experimental { - -class BaseEventManagerInterface { - public: - virtual ~BaseEventManagerInterface() {} -}; - -class EpollEventManagerInterface : public BaseEventManagerInterface {}; - -} // namespace experimental -} // namespace grpc - -#endif /* GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_INTERFACE_H */ diff --git a/src/core/lib/iomgr/poller/eventmanager_libuv.cc b/src/core/lib/iomgr/poller/eventmanager_libuv.cc deleted file mode 100644 index c34430aebdb..00000000000 --- a/src/core/lib/iomgr/poller/eventmanager_libuv.cc +++ /dev/null @@ -1,88 +0,0 @@ -/* - * - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include - -#include "src/core/lib/iomgr/poller/eventmanager_libuv.h" - -#include - -grpc::experimental::LibuvEventManager::Options::Options() : num_workers_(-1) {} -grpc::experimental::LibuvEventManager::Options::Options(int num_workers) - : num_workers_(num_workers) {} - -grpc::experimental::LibuvEventManager::LibuvEventManager(const Options& options) - : options_(options) { - int num_workers = options_.num_workers(); - // Number of workers can't be 0 if we do not accept thread donation. - // TODO(guantaol): replaces the hard-coded number with a flag. - if (num_workers <= 0) num_workers = 32; - - for (int i = 0; i < num_workers; i++) { - workers_.emplace_back( - options_.thread_name_prefix().c_str(), - [](void* em) { static_cast(em)->RunWorkerLoop(); }, - this); - workers_.back().Start(); - } -} - -grpc::experimental::LibuvEventManager::~LibuvEventManager() { - Shutdown(); - for (auto& th : workers_) { - th.Join(); - } -} - -void grpc::experimental::LibuvEventManager::RunWorkerLoop() { - while (true) { - // TODO(guantaol): extend the worker loop with real work. - if (ShouldStop()) return; - gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), - gpr_time_from_micros(10, GPR_TIMESPAN))); - } -} - -bool grpc::experimental::LibuvEventManager::ShouldStop() { - return should_stop_.Load(grpc_core::MemoryOrder::ACQUIRE) != 0; -} - -void grpc::experimental::LibuvEventManager::Shutdown() { - if (should_stop_.Load(grpc_core::MemoryOrder::ACQUIRE)) { - return; // Already shut down. - } - - { - grpc_core::MutexLock lock(&shutdown_mu_); - while (shutdown_refcount_.Load(grpc_core::MemoryOrder::ACQUIRE) > 0) { - shutdown_cv_.Wait(&shutdown_mu_); - } - } - should_stop_.Store(true, grpc_core::MemoryOrder::RELEASE); -} - -void grpc::experimental::LibuvEventManager::ShutdownRef() { - shutdown_refcount_.FetchAdd(1, grpc_core::MemoryOrder::RELAXED); -} - -void grpc::experimental::LibuvEventManager::ShutdownUnref() { - if (shutdown_refcount_.FetchSub(1, grpc_core::MemoryOrder::ACQ_REL) == 1) { - grpc_core::MutexLock lock(&shutdown_mu_); - shutdown_cv_.Signal(); - } -} diff --git a/src/core/lib/iomgr/poller/eventmanager_libuv.h b/src/core/lib/iomgr/poller/eventmanager_libuv.h deleted file mode 100644 index 0bd0ecc4161..00000000000 --- a/src/core/lib/iomgr/poller/eventmanager_libuv.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_LIBUV_H -#define GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_LIBUV_H - -#include - -#include -#include - -#include "src/core/lib/gprpp/atomic.h" -#include "src/core/lib/gprpp/sync.h" -#include "src/core/lib/gprpp/thd.h" - -namespace grpc { -namespace experimental { - -class LibuvEventManager { - public: - class Options { - public: - Options(); - explicit Options(int num_workers); - - int num_workers() const { return num_workers_; } - void set_num_workers(int num) { num_workers_ = num; } - - const std::string& thread_name_prefix() const { - return thread_name_prefix_; - } - void set_thread_name_prefix(const std::string& name) { - thread_name_prefix_ = name; - } - - private: - // Number of worker threads to create at startup. If less than 0, uses the - // default value of 32. - int num_workers_; - // Name prefix used for worker. - std::string thread_name_prefix_; - }; - - explicit LibuvEventManager(const Options& options); - virtual ~LibuvEventManager(); - - void Shutdown(); - void ShutdownRef(); - void ShutdownUnref(); - - private: - // Function run by the worker threads. - void RunWorkerLoop(); - - // Whether the EventManager has been shut down. - bool ShouldStop(); - - const Options options_; - // Whether the EventManager workers should be stopped. - grpc_core::Atomic should_stop_{false}; - // A refcount preventing the EventManager from shutdown. - grpc_core::Atomic shutdown_refcount_{0}; - // Worker threads of the EventManager. - std::vector workers_; - // Mutex and condition variable used for shutdown. - grpc_core::Mutex shutdown_mu_; - grpc_core::CondVar shutdown_cv_; -}; - -} // namespace experimental -} // namespace grpc - -#endif /* GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_LIBUV_H */ diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index e7ee6a7f112..a97bf7e7f7e 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -434,7 +434,6 @@ CORE_SOURCE_FILES = [ 'src/core/lib/iomgr/load_file.cc', 'src/core/lib/iomgr/lockfree_event.cc', 'src/core/lib/iomgr/parse_address.cc', - 'src/core/lib/iomgr/poller/eventmanager_libuv.cc', 'src/core/lib/iomgr/polling_entity.cc', 'src/core/lib/iomgr/pollset.cc', 'src/core/lib/iomgr/pollset_custom.cc', diff --git a/test/core/iomgr/poller/BUILD b/test/core/iomgr/poller/BUILD deleted file mode 100644 index e5998f3546c..00000000000 --- a/test/core/iomgr/poller/BUILD +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2019 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_package") - -licenses(["notice"]) - -grpc_package( - name = "test/core/iomgr/poller", - visibility = "public", -) # Used to test IO poller implementations. - -grpc_cc_test( - name = "eventmanager_libuv_test", - srcs = ["eventmanager_libuv_test.cc"], - external_deps = [ - "gtest", - ], - language = "C++", - tags = [ - # TSAN has a false-positive for ShutdownRefAsync - # https://github.com/grpc/grpc/issues/24242 - "notsan", - ], - uses_polling = False, - deps = [ - "//:eventmanager_libuv", - "//:grpc_base_c", - "//test/core/util:grpc_test_util", - ], -) diff --git a/test/core/iomgr/poller/eventmanager_libuv_test.cc b/test/core/iomgr/poller/eventmanager_libuv_test.cc deleted file mode 100644 index 82b6de1b913..00000000000 --- a/test/core/iomgr/poller/eventmanager_libuv_test.cc +++ /dev/null @@ -1,90 +0,0 @@ - -/* - * - * Copyright 2019 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include "src/core/lib/iomgr/poller/eventmanager_libuv.h" - -#include -#include -#include - -#include "test/core/util/test_config.h" - -using grpc::experimental::LibuvEventManager; - -namespace grpc_core { -namespace { - -TEST(LibuvEventManager, Allocation) { - for (int i = 0; i < 10; i++) { - LibuvEventManager* em = - new LibuvEventManager(LibuvEventManager::Options(i)); - gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(1)); - delete em; - } -} - -TEST(LibuvEventManager, ShutdownRef) { - for (int i = 0; i < 10; i++) { - LibuvEventManager* em = - new LibuvEventManager(LibuvEventManager::Options(i)); - for (int j = 0; j < i; j++) { - em->ShutdownRef(); - } - gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(1)); - for (int j = 0; j < i; j++) { - em->ShutdownUnref(); - } - delete em; - } -} - -TEST(LibuvEventManager, ShutdownRefAsync) { - for (int i = 0; i < 10; i++) { - LibuvEventManager* em = - new LibuvEventManager(LibuvEventManager::Options(i)); - for (int j = 0; j < i; j++) { - em->ShutdownRef(); - } - // TSAN doesn't like this approach although this would work. TSAN considers - // it dangerous to have a destructor being called while its member function - // is called but LibuvEventManager handles this by making LibuvEventManager - // wait until all pending operations finish. - grpc_core::Thread deleter( - "deleter", [](void* em) { delete static_cast(em); }, - em); - deleter.Start(); - gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(1)); - for (int j = 0; j < i; j++) { - em->ShutdownUnref(); - } - deleter.Join(); - } -} - -} // namespace -} // namespace grpc_core - -int main(int argc, char** argv) { - grpc_init(); - grpc::testing::TestEnvironment env(argc, argv); - ::testing::InitGoogleTest(&argc, argv); - int retval = RUN_ALL_TESTS(); - grpc_shutdown(); - return retval; -} diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index a3069836a9e..c4a4f434cfc 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -1838,8 +1838,6 @@ src/core/lib/iomgr/lockfree_event.h \ src/core/lib/iomgr/nameser.h \ src/core/lib/iomgr/parse_address.cc \ src/core/lib/iomgr/parse_address.h \ -src/core/lib/iomgr/poller/eventmanager_libuv.cc \ -src/core/lib/iomgr/poller/eventmanager_libuv.h \ src/core/lib/iomgr/polling_entity.cc \ src/core/lib/iomgr/polling_entity.h \ src/core/lib/iomgr/pollset.cc \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index d912a73a580..b77a05dc344 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -1678,8 +1678,6 @@ src/core/lib/iomgr/lockfree_event.h \ src/core/lib/iomgr/nameser.h \ src/core/lib/iomgr/parse_address.cc \ src/core/lib/iomgr/parse_address.h \ -src/core/lib/iomgr/poller/eventmanager_libuv.cc \ -src/core/lib/iomgr/poller/eventmanager_libuv.h \ src/core/lib/iomgr/polling_entity.cc \ src/core/lib/iomgr/polling_entity.h \ src/core/lib/iomgr/pollset.cc \ diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index d902312b13e..6e73afa411a 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -4415,30 +4415,6 @@ ], "uses_polling": true }, - { - "args": [], - "benchmark": false, - "ci_platforms": [ - "linux", - "mac", - "posix", - "windows" - ], - "cpu_cost": 1.0, - "exclude_configs": [], - "exclude_iomgrs": [], - "flaky": false, - "gtest": true, - "language": "c++", - "name": "eventmanager_libuv_test", - "platforms": [ - "linux", - "mac", - "posix", - "windows" - ], - "uses_polling": false - }, { "args": [], "benchmark": false,