diff options
author | Daniil Cherednik <dan.cherednik@gmail.com> | 2022-09-21 20:17:38 +0300 |
---|---|---|
committer | Daniil Cherednik <dan.cherednik@gmail.com> | 2022-09-21 20:17:38 +0300 |
commit | e6c9b17192c56494adba359d5e132c431b241191 (patch) | |
tree | 6f2449871a118a0e8919ce842b1174e06cb470ef /library/cpp/actors | |
parent | 285021ab1aac39e84b269d9bacd4deee69cf63fc (diff) | |
download | ydb-e6c9b17192c56494adba359d5e132c431b241191.tar.gz |
Ydb stable 22-4-2122.4.21
x-stable-origin-commit: e89099581237299a132feafb5b58af59ebd0468a
Diffstat (limited to 'library/cpp/actors')
-rw-r--r-- | library/cpp/actors/CMakeLists.txt | 20 | ||||
-rw-r--r-- | library/cpp/actors/core/event_pb.h | 4 | ||||
-rw-r--r-- | library/cpp/actors/core/log.cpp | 41 | ||||
-rw-r--r-- | library/cpp/actors/core/log.h | 1 | ||||
-rw-r--r-- | library/cpp/actors/http/http_ut.cpp | 1 | ||||
-rw-r--r-- | library/cpp/actors/interconnect/CMakeLists.darwin.txt | 1 | ||||
-rw-r--r-- | library/cpp/actors/interconnect/CMakeLists.linux.txt | 1 | ||||
-rw-r--r-- | library/cpp/actors/interconnect/CMakeLists.txt | 2 | ||||
-rw-r--r-- | library/cpp/actors/interconnect/interconnect_handshake.cpp | 7 | ||||
-rw-r--r-- | library/cpp/actors/interconnect/ut/large.cpp | 2 | ||||
-rw-r--r-- | library/cpp/actors/wilson/CMakeLists.txt | 1 |
11 files changed, 45 insertions, 36 deletions
diff --git a/library/cpp/actors/CMakeLists.txt b/library/cpp/actors/CMakeLists.txt new file mode 100644 index 0000000000..b19b18f7a9 --- /dev/null +++ b/library/cpp/actors/CMakeLists.txt @@ -0,0 +1,20 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(core) +add_subdirectory(dnscachelib) +add_subdirectory(dnsresolver) +add_subdirectory(helpers) +add_subdirectory(http) +add_subdirectory(interconnect) +add_subdirectory(memory_log) +add_subdirectory(prof) +add_subdirectory(protos) +add_subdirectory(testlib) +add_subdirectory(util) +add_subdirectory(wilson) diff --git a/library/cpp/actors/core/event_pb.h b/library/cpp/actors/core/event_pb.h index 061e51fa68..2d388fceeb 100644 --- a/library/cpp/actors/core/event_pb.h +++ b/library/cpp/actors/core/event_pb.h @@ -121,11 +121,7 @@ namespace NActors { bool Finished = false; }; -#ifdef ACTORLIB_HUGE_PB_SIZE static const size_t EventMaxByteSize = 140 << 20; // (140MB) -#else - static const size_t EventMaxByteSize = 67108000; -#endif template <typename TEv, typename TRecord /*protobuf record*/, ui32 TEventType, typename TRecHolder> class TEventPBBase: public TEventBase<TEv, TEventType> , public TRecHolder { diff --git a/library/cpp/actors/core/log.cpp b/library/cpp/actors/core/log.cpp index 5f63b5af58..4bafd45842 100644 --- a/library/cpp/actors/core/log.cpp +++ b/library/cpp/actors/core/log.cpp @@ -77,7 +77,7 @@ namespace NActors { HTML(str) { DIV_CLASS("row") { DIV_CLASS("col-md-12") { - H4() { + TAG(TH4) { str << "Counters" << Endl; } DynamicCounters->OutputHtml(str); @@ -142,7 +142,7 @@ namespace NActors { HTML(str) { DIV_CLASS("row") { DIV_CLASS("col-md-12") { - H4() { + TAG(TH4) { str << "Metrics" << Endl; } // TODO: Now, TMetricRegistry does not have the GetOutputHtml function @@ -164,8 +164,6 @@ namespace NActors { std::shared_ptr<NMonitoring::TMetricRegistry> Metrics; }; - TAtomic TLoggerActor::IsOverflow = 0; - TLoggerActor::TLoggerActor(TIntrusivePtr<NLog::TSettings> settings, TAutoPtr<TLogBackend> logBackend, TIntrusivePtr<NMonitoring::TDynamicCounters> counters) @@ -224,8 +222,9 @@ namespace NActors { } void TLoggerActor::Throttle(const NLog::TSettings& settings) { - if (AtomicGet(IsOverflow)) - Sleep(settings.ThrottleDelay); + // throttling via Sleep was removed since it causes unexpected + // incidents when users try to set AllowDrop=false. + Y_UNUSED(settings); } void TLoggerActor::LogIgnoredCount(TInstant now) { @@ -268,10 +267,6 @@ namespace NActors { i64 delayMillisec = (ctx.Now() - ev->Get()->Stamp).MilliSeconds(); WriteMessageStat(*ev->Get()); if (Settings->AllowDrop) { - // Disable throttling if it was enabled previously - if (AtomicGet(IsOverflow)) - AtomicSet(IsOverflow, 0); - // Check if some records have to be dropped if ((PassedCount > 10 && delayMillisec > (i64)Settings->TimeThresholdMs) || IgnoredCount > 0) { Metrics->IncIgnoredMsgs(); @@ -283,12 +278,6 @@ namespace NActors { return; } PassedCount++; - } else { - // Enable of disable throttling depending on the load - if (delayMillisec > (i64)Settings->TimeThresholdMs && !AtomicGet(IsOverflow)) - AtomicSet(IsOverflow, 1); - else if (delayMillisec <= (i64)Settings->TimeThresholdMs && AtomicGet(IsOverflow)) - AtomicSet(IsOverflow, 0); } const auto prio = ev->Get()->Level.ToPrio(); @@ -312,7 +301,7 @@ namespace NActors { void TLoggerActor::RenderComponentPriorities(IOutputStream& str) { using namespace NLog; HTML(str) { - H4() { + TAG(TH4) { str << "Priority Settings for the Components"; } TABLE_SORTABLE_CLASS("table") { @@ -415,7 +404,7 @@ namespace NActors { HTML(str) { DIV_CLASS("row") { DIV_CLASS("col-md-12") { - H4() { + TAG(TH4) { str << "Current log settings for " << Settings->ComponentName(component) << Endl; } UL() { @@ -437,7 +426,7 @@ namespace NActors { DIV_CLASS("row") { DIV_CLASS("col-md-12") { - H4() { + TAG(TH4) { str << "Change priority" << Endl; } UL() { @@ -448,7 +437,7 @@ namespace NActors { } } } - H4() { + TAG(TH4) { str << "Change sampling priority" << Endl; } UL() { @@ -459,7 +448,7 @@ namespace NActors { } } } - H4() { + TAG(TH4) { str << "Change sampling rate" << Endl; } str << "<form method=\"GET\">" << Endl; @@ -467,7 +456,7 @@ namespace NActors { str << "<input type=\"hidden\" name=\"c\" value=\"" << component << "\">" << Endl; str << "<input class=\"btn btn-primary\" type=\"submit\" value=\"Change\"/>" << Endl; str << "</form>" << Endl; - H4() { + TAG(TH4) { str << "<a href='logger'>Cancel</a>" << Endl; } } @@ -503,7 +492,7 @@ namespace NActors { RenderComponentPriorities(str); } DIV_CLASS("col-md-6") { - H4() { + TAG(TH4) { str << "Change priority for all components"; } TABLE_CLASS("table table-condensed") { @@ -525,7 +514,7 @@ namespace NActors { } } } - H4() { + TAG(TH4) { str << "Change sampling priority for all components"; } TABLE_CLASS("table table-condensed") { @@ -547,7 +536,7 @@ namespace NActors { } } } - H4() { + TAG(TH4) { str << "Change sampling rate for all components"; } str << "<form method=\"GET\">" << Endl; @@ -555,7 +544,7 @@ namespace NActors { str << "<input type=\"hidden\" name=\"c\" value=\"-1\">" << Endl; str << "<input class=\"btn btn-primary\" type=\"submit\" value=\"Change\"/>" << Endl; str << "</form>" << Endl; - H4() { + TAG(TH4) { str << "Drop log entries in case of overflow: " << (Settings->AllowDrop ? "Enabled" : "Disabled"); } diff --git a/library/cpp/actors/core/log.h b/library/cpp/actors/core/log.h index c11a7cf3c1..96cbb81958 100644 --- a/library/cpp/actors/core/log.h +++ b/library/cpp/actors/core/log.h @@ -239,7 +239,6 @@ namespace NActors { std::shared_ptr<TLogBackend> LogBackend; ui64 IgnoredCount = 0; ui64 PassedCount = 0; - static TAtomic IsOverflow; TDuration WakeupInterval{TDuration::Seconds(5)}; std::unique_ptr<ILoggerMetrics> Metrics; diff --git a/library/cpp/actors/http/http_ut.cpp b/library/cpp/actors/http/http_ut.cpp index 7a569a08c3..d7d4f5567f 100644 --- a/library/cpp/actors/http/http_ut.cpp +++ b/library/cpp/actors/http/http_ut.cpp @@ -379,6 +379,7 @@ CRA/5XcX13GJwHHj6LCoc3sL7mt8qV9HKY2AOZ88mpObzISZxgPpdKCfjsrdm63V Y_UNIT_TEST(TooLongHeader) { NActors::TTestActorRuntimeBase actorSystem; + actorSystem.SetUseRealInterconnect(); TPortManager portManager; TIpPort port = portManager.GetTcpPort(); TAutoPtr<NActors::IEventHandle> handle; diff --git a/library/cpp/actors/interconnect/CMakeLists.darwin.txt b/library/cpp/actors/interconnect/CMakeLists.darwin.txt index 9bd0c83fce..f73af2defe 100644 --- a/library/cpp/actors/interconnect/CMakeLists.darwin.txt +++ b/library/cpp/actors/interconnect/CMakeLists.darwin.txt @@ -7,6 +7,7 @@ find_package(OpenSSL REQUIRED) +add_subdirectory(mock) add_library(cpp-actors-interconnect) target_link_libraries(cpp-actors-interconnect PUBLIC diff --git a/library/cpp/actors/interconnect/CMakeLists.linux.txt b/library/cpp/actors/interconnect/CMakeLists.linux.txt index c0e1b39c45..94a7bda34d 100644 --- a/library/cpp/actors/interconnect/CMakeLists.linux.txt +++ b/library/cpp/actors/interconnect/CMakeLists.linux.txt @@ -7,6 +7,7 @@ find_package(OpenSSL REQUIRED) +add_subdirectory(mock) add_library(cpp-actors-interconnect) target_link_libraries(cpp-actors-interconnect PUBLIC diff --git a/library/cpp/actors/interconnect/CMakeLists.txt b/library/cpp/actors/interconnect/CMakeLists.txt index fc7b1ee73c..dbfe6fa2c4 100644 --- a/library/cpp/actors/interconnect/CMakeLists.txt +++ b/library/cpp/actors/interconnect/CMakeLists.txt @@ -8,6 +8,6 @@ if (APPLE) include(CMakeLists.darwin.txt) -elseif (UNIX AND NOT APPLE) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE) include(CMakeLists.linux.txt) endif() diff --git a/library/cpp/actors/interconnect/interconnect_handshake.cpp b/library/cpp/actors/interconnect/interconnect_handshake.cpp index aaa8440d72..d7f657299e 100644 --- a/library/cpp/actors/interconnect/interconnect_handshake.cpp +++ b/library/cpp/actors/interconnect/interconnect_handshake.cpp @@ -551,6 +551,7 @@ namespace NActors { // set up incoming socket SetupSocket(); + RegisterInPoller(); // wait for initial request packet TInitialPacket request; @@ -878,8 +879,11 @@ namespace NActors { // start connecting err = -Socket->Connect(address); if (err == EINPROGRESS) { + RegisterInPoller(); WaitPoller(false, true, "WaitConnect"); err = Socket->GetConnectStatus(); + } else if (!err) { + RegisterInPoller(); } // check if connection succeeded @@ -915,9 +919,6 @@ namespace NActors { // setup send buffer size Socket->SetSendBufferSize(Common->Settings.GetSendBufferSize()); - - // register in poller - RegisterInPoller(); } void RegisterInPoller() { diff --git a/library/cpp/actors/interconnect/ut/large.cpp b/library/cpp/actors/interconnect/ut/large.cpp index ba2a50c6f6..192d733325 100644 --- a/library/cpp/actors/interconnect/ut/large.cpp +++ b/library/cpp/actors/interconnect/ut/large.cpp @@ -24,7 +24,7 @@ Y_UNIT_TEST_SUITE(LargeMessage) { void Bootstrap(const TActorContext& ctx) { Become(&TThis::StateFunc); ctx.Send(RecipientActorId, new TEvTest(1, "hello"), IEventHandle::FlagTrackDelivery, 1); - ctx.Send(RecipientActorId, new TEvTest(2, TString(128 * 1024 * 1024, 'X')), IEventHandle::FlagTrackDelivery, 2); + ctx.Send(RecipientActorId, new TEvTest(2, TString(150 * 1024 * 1024, 'X')), IEventHandle::FlagTrackDelivery, 2); } void Handle(TEvents::TEvUndelivered::TPtr ev, const TActorContext& ctx) { diff --git a/library/cpp/actors/wilson/CMakeLists.txt b/library/cpp/actors/wilson/CMakeLists.txt index 75c7b16dff..31566c2628 100644 --- a/library/cpp/actors/wilson/CMakeLists.txt +++ b/library/cpp/actors/wilson/CMakeLists.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(protos) add_library(cpp-actors-wilson) target_link_libraries(cpp-actors-wilson PUBLIC |