Skip to content

Commit f701ab5

Browse files
authored
EXT-1546 Fix monitoring race between shutdown and pages registration (#25921) (#26036)
2 parents 04cc71e + 33802fd commit f701ab5

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

ydb/core/mon/mon.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,6 +1380,10 @@ TMon::TMon(TConfig config)
13801380
{
13811381
}
13821382

1383+
TMon::~TMon() {
1384+
IndexMonPage->ClearPages(); // it's required to avoid loop-reference
1385+
}
1386+
13831387
std::future<void> TMon::Start(TActorSystem* actorSystem) {
13841388
Y_ABORT_UNLESS(actorSystem);
13851389
TGuard<TMutex> g(Mutex);
@@ -1456,9 +1460,8 @@ std::future<void> TMon::Start(TActorSystem* actorSystem) {
14561460
}
14571461

14581462
void TMon::Stop() {
1459-
IndexMonPage->ClearPages(); // it's required to avoid loop-reference
1463+
TGuard<TMutex> g(Mutex);
14601464
if (ActorSystem) {
1461-
TGuard<TMutex> g(Mutex);
14621465
for (const auto& [path, actorId] : ActorServices) {
14631466
ActorSystem->Send(actorId, new TEvents::TEvPoisonPill);
14641467
}

ydb/core/mon/mon.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class TMon {
4242
};
4343

4444
TMon(TConfig config);
45-
virtual ~TMon() = default;
45+
virtual ~TMon();
4646

4747
std::future<void> Start(TActorSystem* actorSystem); // signals when monitoring is ready
4848
void Stop();

0 commit comments

Comments
 (0)