aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksei Borzenkov <snaury@ydb.tech>2024-11-21 14:52:35 +0300
committerGitHub <noreply@github.com>2024-11-21 11:52:35 +0000
commitea7a15c669a451e36a3fca600c134928cd13fc57 (patch)
tree50101b62261cc3fc6c1b5ae57d1d54e5daf53985
parent923d372e7b921d6a628f8c9ced5b183523dbd5e5 (diff)
downloadydb-ea7a15c669a451e36a3fca600c134928cd13fc57.tar.gz
Make sure mailboxes in test actorsystems are in a locked state (#11837)
-rw-r--r--ydb/core/util/actorsys_test/testactorsys.h5
-rw-r--r--ydb/library/actors/testlib/test_runtime.cpp2
2 files changed, 5 insertions, 2 deletions
diff --git a/ydb/core/util/actorsys_test/testactorsys.h b/ydb/core/util/actorsys_test/testactorsys.h
index df7d5bc027..492d1f23a0 100644
--- a/ydb/core/util/actorsys_test/testactorsys.h
+++ b/ydb/core/util/actorsys_test/testactorsys.h
@@ -492,9 +492,12 @@ public:
}
// register actor in mailbox
- const auto& it = Mailboxes.try_emplace(TMailboxId(nodeId, poolId, mboxId)).first;
+ auto [it, mboxInserted] = Mailboxes.try_emplace(TMailboxId(nodeId, poolId, mboxId));
TMailboxInfo& mbox = it->second;
mbox.Hint = mboxId;
+ if (mboxInserted) {
+ mbox.LockFromFree();
+ }
mbox.AttachActor(ActorLocalId, actor);
// generate actor id
diff --git a/ydb/library/actors/testlib/test_runtime.cpp b/ydb/library/actors/testlib/test_runtime.cpp
index acf7332c91..daec639296 100644
--- a/ydb/library/actors/testlib/test_runtime.cpp
+++ b/ydb/library/actors/testlib/test_runtime.cpp
@@ -928,7 +928,7 @@ namespace NActors {
RegistrationObserver(*this, parentId ? parentId : CurrentRecipient, actorId);
DoActorInit(node->ActorSystem.Get(), actor, actorId, parentId ? parentId : CurrentRecipient);
- mailbox->Unlock(node->ExecutorPools[0], GetCycleCountFast(), revolvingCounter);
+ // Note: test actorsystem mailboxes stay permanently locked
return actorId;
}