Skip to content

Commit

Permalink
Make sure mailboxes in test actorsystems are in a locked state (#11837)
Browse files Browse the repository at this point in the history
  • Loading branch information
snaury authored Nov 21, 2024
1 parent 923d372 commit ea7a15c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion ydb/core/util/actorsys_test/testactorsys.h
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,12 @@ class TTestActorSystem {
}

// 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
Expand Down
2 changes: 1 addition & 1 deletion ydb/library/actors/testlib/test_runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit ea7a15c

Please sign in to comment.