aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorserg-belyakov <serg-belyakov@yandex-team.com>2023-03-17 16:46:15 +0300
committerserg-belyakov <serg-belyakov@yandex-team.com>2023-03-17 16:46:15 +0300
commit301dd8be69dd6a92ad204547887831fb3c50a53a (patch)
treee6876a24364bd7bd4788b87d0e29f8931e8385ae
parent0e6e524d966001c8bf2cfc8b1d63af89df3ea2af (diff)
downloadydb-301dd8be69dd6a92ad204547887831fb3c50a53a.tar.gz
Remove redundant BrokerLeaseHolder resets, fix SIGSEGV in huge_cluster tests,
Remove redundant LeaseHolder resets
-rw-r--r--library/cpp/actors/interconnect/interconnect_handshake.cpp6
-rw-r--r--library/cpp/actors/interconnect/ut/lib/node.h2
-rw-r--r--library/cpp/actors/interconnect/ut_huge_cluster/huge_cluster.cpp75
3 files changed, 35 insertions, 48 deletions
diff --git a/library/cpp/actors/interconnect/interconnect_handshake.cpp b/library/cpp/actors/interconnect/interconnect_handshake.cpp
index c76f5047d5..b0c4e79b32 100644
--- a/library/cpp/actors/interconnect/interconnect_handshake.cpp
+++ b/library/cpp/actors/interconnect/interconnect_handshake.cpp
@@ -135,11 +135,6 @@ namespace NActors {
}
}
- ~THandshakeActor() {
- // BrokerLeaseHolder sends messages in destuctor, so it must be deleted before other actor's components
- BrokerLeaseHolder.reset();
- }
-
void UpdatePrefix() {
SetPrefix(Sprintf("Handshake %s [node %" PRIu32 "]", SelfActorId.ToString().data(), PeerNodeId));
}
@@ -217,7 +212,6 @@ namespace NActors {
}
Socket.Reset();
- BrokerLeaseHolder.reset();
}
void EstablishSecureConnection() {
diff --git a/library/cpp/actors/interconnect/ut/lib/node.h b/library/cpp/actors/interconnect/ut/lib/node.h
index 06e6a2646c..0b538cdb1c 100644
--- a/library/cpp/actors/interconnect/ut/lib/node.h
+++ b/library/cpp/actors/interconnect/ut/lib/node.h
@@ -45,7 +45,7 @@ public:
common->Settings.SendBufferDieLimitInMB = 512;
common->Settings.TotalInflightAmountOfData = 512 * 1024;
common->Settings.TCPSocketBufferSize = 2048 * 1024;
- common->OutgoingHandshakeInflightLimit = 10;
+ common->OutgoingHandshakeInflightLimit = 3;
setup.Interconnect.ProxyActors.resize(numNodes + 1 - numDynamicNodes);
setup.Interconnect.ProxyWrapperFactory = CreateProxyWrapperFactory(common, interconnectPoolId);
diff --git a/library/cpp/actors/interconnect/ut_huge_cluster/huge_cluster.cpp b/library/cpp/actors/interconnect/ut_huge_cluster/huge_cluster.cpp
index 45a41df3c5..458ead3459 100644
--- a/library/cpp/actors/interconnect/ut_huge_cluster/huge_cluster.cpp
+++ b/library/cpp/actors/interconnect/ut_huge_cluster/huge_cluster.cpp
@@ -107,68 +107,61 @@ Y_UNIT_TEST_SUITE(HugeCluster) {
}
Y_UNIT_TEST(AllToAll) {
- ui32 nodesNum = 200;
-
- TTestICCluster testCluster(nodesNum, NActors::TChannelsConfig(), nullptr, MakeLogConfigs(NLog::PRI_EMERG));
-
+ ui32 nodesNum = 120;
std::vector<TActorId> pollers(nodesNum);
std::vector<std::unordered_map<TActorId, TManualEvent>> events(nodesNum);
- for (ui32 i = 0; i < nodesNum; ++i) {
- pollers[i] = testCluster.RegisterActor(new TPoller(pollers, events[i]), i + 1);
- }
+ // Must destroy actor system before shared arrays
+ {
+ TTestICCluster testCluster(nodesNum, NActors::TChannelsConfig(), nullptr, MakeLogConfigs(NLog::PRI_EMERG));
- for (ui32 i = 0; i < nodesNum; ++i) {
- for (const auto& actor : pollers) {
- events[i][actor] = TManualEvent();
+ for (ui32 i = 0; i < nodesNum; ++i) {
+ pollers[i] = testCluster.RegisterActor(new TPoller(pollers, events[i]), i + 1);
}
- }
- const TActorId startPollers = testCluster.RegisterActor(new TStartPollers(pollers), 1);
-
- for (ui32 i = 0; i < nodesNum; ++i) {
- for (auto& [_, ev] : events[i]) {
- ev.WaitI();
+ for (ui32 i = 0; i < nodesNum; ++i) {
+ for (const auto& actor : pollers) {
+ events[i][actor] = TManualEvent();
+ }
}
- }
- // kill actors to avoid use-after-free
- for (ui32 i = 0; i < nodesNum; ++i) {
- testCluster.KillActor(i + 1, pollers[i]);
+ testCluster.RegisterActor(new TStartPollers(pollers), 1);
+
+ for (ui32 i = 0; i < nodesNum; ++i) {
+ for (auto& [_, ev] : events[i]) {
+ ev.WaitI();
+ }
+ }
}
- testCluster.KillActor(1, startPollers);
}
Y_UNIT_TEST(AllToOne) {
- ui32 nodesNum = 1000;
-
- TTestICCluster testCluster(nodesNum, NActors::TChannelsConfig(), nullptr, MakeLogConfigs(NLog::PRI_EMERG));
-
+ ui32 nodesNum = 500;
+ std::vector<TActorId> listeners;
std::vector<TActorId> pollers(nodesNum - 1);
std::unordered_map<TActorId, TManualEvent> events;
std::unordered_map<TActorId, TManualEvent> emptyEventList;
- const TActorId listener = testCluster.RegisterActor(new TPoller({}, events), nodesNum);
- for (ui32 i = 0; i < nodesNum - 1; ++i) {
- pollers[i] = testCluster.RegisterActor(new TPoller({ listener }, emptyEventList), i + 1);
- }
+ // Must destroy actor system before shared arrays
+ {
+ TTestICCluster testCluster(nodesNum, NActors::TChannelsConfig(), nullptr, MakeLogConfigs(NLog::PRI_EMERG));
- for (const auto& actor : pollers) {
- events[actor] = TManualEvent();
- }
+ const TActorId listener = testCluster.RegisterActor(new TPoller({}, events), nodesNum);
+ listeners = { listener };
+ for (ui32 i = 0; i < nodesNum - 1; ++i) {
+ pollers[i] = testCluster.RegisterActor(new TPoller(listeners, emptyEventList), i + 1);
+ }
- const TActorId startPollers = testCluster.RegisterActor(new TStartPollers(pollers), 1);
+ for (const auto& actor : pollers) {
+ events[actor] = TManualEvent();
+ }
- for (auto& [_, ev] : events) {
- ev.WaitI();
- }
+ testCluster.RegisterActor(new TStartPollers(pollers), 1);
- // kill actors to avoid use-after-free
- for (ui32 i = 0; i < pollers.size(); ++i) {
- testCluster.KillActor(i + 1, pollers[i]);
+ for (auto& [_, ev] : events) {
+ ev.WaitI();
+ }
}
- testCluster.KillActor(nodesNum, listener);
- testCluster.KillActor(1, startPollers);
}
}