aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkulikov <kulikov@yandex-team.com>2022-11-03 14:50:26 +0300
committerkulikov <kulikov@yandex-team.com>2022-11-03 14:50:26 +0300
commitf6313e0ed2947ba490bb9b21781ec57cc839d1e9 (patch)
treea684fdf362652bfcc89f6f3d0d1c7333b9c84c12
parent65ab9f6a97c184f41f7a5de0b031336dd32c6d4f (diff)
downloadydb-f6313e0ed2947ba490bb9b21781ec57cc839d1e9.tar.gz
,completely remove combined poller
- no significant perfomance gain by now; - balancer doesn't use combined poller; - tests over combined poller normally check only one part; - poll and epoll have some differences in behaivor; - there is probably a bug somewhere (uncaught exception on switch from poll to epoll).
-rw-r--r--library/cpp/coroutine/engine/coroutine_ut.cpp12
-rw-r--r--library/cpp/coroutine/engine/poller.cpp50
-rw-r--r--library/cpp/coroutine/engine/poller.h1
3 files changed, 19 insertions, 44 deletions
diff --git a/library/cpp/coroutine/engine/coroutine_ut.cpp b/library/cpp/coroutine/engine/coroutine_ut.cpp
index c8a1852f7c..b4d0b62543 100644
--- a/library/cpp/coroutine/engine/coroutine_ut.cpp
+++ b/library/cpp/coroutine/engine/coroutine_ut.cpp
@@ -32,8 +32,8 @@ class TCoroTest: public TTestBase {
UNIT_TEST(TestException);
UNIT_TEST(TestJoinCancelExitRaceBug);
UNIT_TEST(TestWaitWakeLivelockBug);
- UNIT_TEST(TestFastPathWakeDefault)
- // TODO (velavokr): BALANCER-1338 our epoll wrapper cannot handle pipe eofs
+// TODO (velavokr): BALANCER-1338 our epoll wrapper cannot handle pipe eofs
+// UNIT_TEST(TestFastPathWakeDefault)
// UNIT_TEST(TestFastPathWakeEpoll)
UNIT_TEST(TestFastPathWakeKqueue)
UNIT_TEST(TestFastPathWakePoll)
@@ -936,7 +936,13 @@ void TCoroTest::TestPollEngines() {
if (engine == EContPoller::Default) {
defaultChecked = true;
- UNIT_ASSERT_VALUES_EQUAL(exec.Poller()->PollEngine(), EContPoller::Combined);
+#if defined(HAVE_EPOLL_POLLER)
+ UNIT_ASSERT_VALUES_EQUAL(exec.Poller()->PollEngine(), EContPoller::Epoll);
+#elif defined(HAVE_KQUEUE_POLLER)
+ UNIT_ASSERT_VALUES_EQUAL(exec.Poller()->PollEngine(), EContPoller::Kqueue);
+#else
+ UNIT_ASSERT_VALUES_EQUAL(exec.Poller()->PollEngine(), EContPoller::Select);
+#endif
} else {
UNIT_ASSERT_VALUES_EQUAL(exec.Poller()->PollEngine(), engine);
}
diff --git a/library/cpp/coroutine/engine/poller.cpp b/library/cpp/coroutine/engine/poller.cpp
index 61164fa56b..bcd31d209c 100644
--- a/library/cpp/coroutine/engine/poller.cpp
+++ b/library/cpp/coroutine/engine/poller.cpp
@@ -310,43 +310,6 @@ namespace {
TPollVec T_;
};
-
- class TCombinedPoller {
- typedef TPoller<TPollerImpl<TWithoutLocking>> TDefaultPoller;
-
- public:
- TCombinedPoller() {
- P_.Reset(new TPollPoller());
- }
-
- void Set(const TChange& c) {
- if (!P_) {
- D_->Set(c);
- } else {
- P_->Set(c);
- }
- }
-
- void Wait(TEvents& events, TInstant deadLine) {
- if (!P_) {
- D_->Wait(events, deadLine);
- } else {
- if (P_->Size() > 200) {
- D_.Reset(new TDefaultPoller());
- P_->Build(*D_);
- P_.Destroy();
- D_->Wait(events, deadLine);
- } else {
- P_->Wait(events, deadLine);
- }
- }
- }
-
- private:
- THolder<TPollPoller> P_;
- THolder<TDefaultPoller> D_;
- };
-
struct TUserPoller: public TString {
TUserPoller()
: TString(GetEnv("USER_POLLER"))
@@ -364,10 +327,17 @@ THolder<IPollerFace> IPollerFace::Construct(TStringBuf name) {
}
THolder<IPollerFace> IPollerFace::Construct(EContPoller poller) {
+ if (poller == EContPoller::Default) {
+#if defined (HAVE_EPOLL_POLLER)
+ poller = EContPoller::Epoll;
+#elif defined(HAVE_KQUEUE_POLLER)
+ poller = EContPoller::Kqueue;
+#else
+ poller = EContPoller::Select;
+#endif
+ }
+
switch (poller) {
- case EContPoller::Default:
- case EContPoller::Combined:
- return MakeHolder<TVirtualize<TCombinedPoller>>(EContPoller::Combined);
case EContPoller::Select:
return MakeHolder<TVirtualize<TPoller<TGenericPoller<TSelectPoller<TWithoutLocking>>>>>(poller);
case EContPoller::Poll:
diff --git a/library/cpp/coroutine/engine/poller.h b/library/cpp/coroutine/engine/poller.h
index 8ea012c0fc..6116a604a6 100644
--- a/library/cpp/coroutine/engine/poller.h
+++ b/library/cpp/coroutine/engine/poller.h
@@ -8,7 +8,6 @@
enum class EContPoller {
Default /* "default" */,
- Combined /* "combined" */,
Select /* "select" */,
Poll /* "poll" */,
Epoll /* "epoll" */,