Skip to content

Commit 3b3b4a4

Browse files
authored
Merge aece235 into 6239f14
2 parents 6239f14 + aece235 commit 3b3b4a4

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

ydb/library/actors/core/actorsystem.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ namespace NActors {
125125
if (!target) {
126126
target = actorId;
127127
ServiceMap->RegisterLocalService(recipient, target);
128+
DynamicProxies.push_back(target);
128129
}
129130
}
130131
if (target != actorId) {
@@ -232,10 +233,21 @@ namespace NActors {
232233

233234
ui32 TActorSystem::BroadcastToProxies(const std::function<IEventHandle*(const TActorId&)>& eventFabric) {
234235
// TODO: get rid of this method
236+
ui32 res = 0;
235237
for (ui32 i = 0; i < InterconnectCount; ++i) {
236238
Send(eventFabric(Interconnect[i]));
239+
++res;
237240
}
238-
return InterconnectCount;
241+
242+
auto guard = Guard(ProxyCreationLock);
243+
for (size_t i = 0; i < DynamicProxies.size(); ++i) {
244+
const TActorId actorId = DynamicProxies[i];
245+
auto unguard = Unguard(guard);
246+
Send(eventFabric(actorId));
247+
++res;
248+
}
249+
250+
return res;
239251
}
240252

241253
TActorId TActorSystem::LookupLocalService(const TActorId& x) const {

ydb/library/actors/core/actorsystem.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ namespace NActors {
161161
TIntrusivePtr<NLog::TSettings> LoggerSettings0;
162162
TProxyWrapperFactory ProxyWrapperFactory;
163163
TMutex ProxyCreationLock;
164+
mutable std::vector<TActorId> DynamicProxies;
164165

165166
bool StartExecuted;
166167
bool StopExecuted;

0 commit comments

Comments
 (0)