aboutsummaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorCthulhu <cthulhu@yandex-team.ru>2022-02-15 15:32:38 +0300
committerCthulhu <cthulhu@yandex-team.ru>2022-02-15 15:32:38 +0300
commit88a0dbd31f7d2b1684b072dfde6927c3711adec9 (patch)
treee0058988b6d99fa3dd9733396f923d342ef3538f /library
parentf9211a752e27e7a9915c4ab07d73c86089a3f1c9 (diff)
downloadydb-88a0dbd31f7d2b1684b072dfde6927c3711adec9.tar.gz
Fix actor system tests and united pool configuration, KIKIMR-14263
ref:b4161ce289e5bcecd2684a433c331785b201438f
Diffstat (limited to 'library')
-rw-r--r--library/cpp/actors/core/balancer.cpp12
-rw-r--r--library/cpp/actors/core/config.h6
-rw-r--r--library/cpp/actors/core/executor_pool_united_ut.cpp2
-rw-r--r--library/cpp/actors/core/mon_stats.h2
-rw-r--r--library/cpp/actors/protos/unittests.proto2
5 files changed, 16 insertions, 8 deletions
diff --git a/library/cpp/actors/core/balancer.cpp b/library/cpp/actors/core/balancer.cpp
index cc5417b0b5..3dcc45c56b 100644
--- a/library/cpp/actors/core/balancer.cpp
+++ b/library/cpp/actors/core/balancer.cpp
@@ -128,8 +128,16 @@ namespace NActors {
void Configure(const TBalancingConfig& cfg, const TString& poolName) {
Config = cfg;
// Enforce constraints
- Config.MinCpus = std::clamp<ui32>(Config.MinCpus, 1, Config.Cpus);
- Config.MaxCpus = Max<ui32>(Config.MaxCpus, Config.Cpus);
+ if (Config.Cpus > 0) {
+ Config.MinCpus = std::clamp<ui32>(Config.MinCpus, 1, Config.Cpus);
+ Config.MaxCpus = Max<ui32>(Config.MaxCpus, Config.Cpus);
+ } else {
+ Y_VERIFY(Config.Cpus == 0,
+ "Unexpected negative Config.Cpus# %" PRIi64,
+ (i64)Config.Cpus);
+ Config.MinCpus = 0;
+ Config.MaxCpus = 0;
+ }
PoolName = poolName;
}
};
diff --git a/library/cpp/actors/core/config.h b/library/cpp/actors/core/config.h
index 2486bf4c43..0d65815fd9 100644
--- a/library/cpp/actors/core/config.h
+++ b/library/cpp/actors/core/config.h
@@ -40,7 +40,7 @@ namespace NActors {
TDuration TimePerMailbox = DEFAULT_TIME_PER_MAILBOX;
ui32 EventsPerMailbox = DEFAULT_EVENTS_PER_MAILBOX;
int RealtimePriority = 0;
- ui32 MaxActivityType = 1;
+ ui32 MaxActivityType = 5;
};
struct TIOExecutorPoolConfig {
@@ -48,7 +48,7 @@ namespace NActors {
TString PoolName;
ui32 Threads = 1;
TCpuMask Affinity; // Executor thread affinity
- ui32 MaxActivityType = 1;
+ ui32 MaxActivityType = 5;
};
struct TUnitedExecutorPoolConfig {
@@ -68,7 +68,7 @@ namespace NActors {
ui32 EventsPerMailbox = DEFAULT_EVENTS_PER_MAILBOX;
// Introspection
- ui32 MaxActivityType = 1;
+ ui32 MaxActivityType = 5;
// Long-term balancing
TBalancingConfig Balancing;
diff --git a/library/cpp/actors/core/executor_pool_united_ut.cpp b/library/cpp/actors/core/executor_pool_united_ut.cpp
index d4df17f1b8..a1595d8588 100644
--- a/library/cpp/actors/core/executor_pool_united_ut.cpp
+++ b/library/cpp/actors/core/executor_pool_united_ut.cpp
@@ -169,7 +169,7 @@ Y_UNIT_TEST_SUITE(UnitedExecutorPool) {
UNIT_ASSERT_VALUES_EQUAL(stats[0].EmptyMailboxActivation, 0);
//UNIT_ASSERT_VALUES_EQUAL(stats[0].CpuNs, 0); // depends on total duration of test, so undefined
UNIT_ASSERT(stats[0].ElapsedTicks > 0);
- UNIT_ASSERT(stats[0].ParkedTicks == 0); // per-pool parked time does not make sense for united pools
+ //UNIT_ASSERT(stats[0].ParkedTicks == 0); // per-pool parked time does not make sense for united pools
UNIT_ASSERT_VALUES_EQUAL(stats[0].BlockedTicks, 0);
UNIT_ASSERT(stats[0].ActivationTimeHistogram.TotalSamples >= msgCount / TBasicExecutorPoolConfig::DEFAULT_EVENTS_PER_MAILBOX);
UNIT_ASSERT_VALUES_EQUAL(stats[0].EventDeliveryTimeHistogram.TotalSamples, msgCount);
diff --git a/library/cpp/actors/core/mon_stats.h b/library/cpp/actors/core/mon_stats.h
index d55552af0c..6d482926d1 100644
--- a/library/cpp/actors/core/mon_stats.h
+++ b/library/cpp/actors/core/mon_stats.h
@@ -87,7 +87,7 @@ namespace NActors {
ui64 MailboxPushedOutByTime = 0;
ui64 MailboxPushedOutByEventCount = 0;
- TExecutorThreadStats(size_t activityVecSize = 1) // must be not empty as 0 used as default
+ TExecutorThreadStats(size_t activityVecSize = 5) // must be not empty as 0 used as default
: ElapsedTicksByActivity(activityVecSize)
, ReceivedEventsByActivity(activityVecSize)
, ActorsAliveByActivity(activityVecSize)
diff --git a/library/cpp/actors/protos/unittests.proto b/library/cpp/actors/protos/unittests.proto
index a856b0942a..4b1af85e01 100644
--- a/library/cpp/actors/protos/unittests.proto
+++ b/library/cpp/actors/protos/unittests.proto
@@ -16,5 +16,5 @@ message TBigMessage {
message TMessageWithPayload {
optional string Meta = 1;
repeated uint32 PayloadId = 2;
- repeated string SomeData = 3;
+ repeated bytes SomeData = 3;
}