Skip to content

Commit d8873fb

Browse files
authored
25-2-1: Remove the update from the queue when necessary (#25970)
2 parents 164a847 + 7c25782 commit d8873fb

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

ydb/core/cms/console/console_configs_provider.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,12 @@ void TConfigsProvider::ProcessScheduledUpdates(const TActorContext &ctx)
561561
*Counters.InflightConfigUpdates = InflightUpdates.size();
562562
}
563563

564+
void TConfigsProvider::RemoveSubscription(const TActorId& subscriber) {
565+
InMemoryIndex.RemoveSubscription(subscriber);
566+
ScheduledUpdates.erase(subscriber);
567+
InflightUpdates.erase(subscriber);
568+
}
569+
564570
void TConfigsProvider::CheckSubscription(TSubscription::TPtr subscription,
565571
const TActorContext &ctx)
566572
{
@@ -829,7 +835,7 @@ void TConfigsProvider::Handle(TEvConsole::TEvConfigSubscriptionRequest::TPtr &ev
829835
return;
830836
}
831837

832-
InMemoryIndex.RemoveSubscription(subscriber);
838+
RemoveSubscription(subscriber);
833839
Send(existing->Worker, new TEvents::TEvPoisonPill());
834840
}
835841

@@ -886,18 +892,17 @@ void TConfigsProvider::Handle(TEvConsole::TEvConfigSubscriptionCanceled::TPtr &e
886892

887893
Y_ABORT_UNLESS(subscription->Worker);
888894

889-
InMemoryIndex.RemoveSubscription(subscriber);
895+
RemoveSubscription(subscriber);
890896
Send(subscription->Worker, new TEvents::TEvPoisonPill());
897+
ProcessScheduledUpdates(ctx);
891898
}
892899

893900
void TConfigsProvider::Handle(TEvPrivate::TEvWorkerDisconnected::TPtr &ev, const TActorContext &ctx)
894901
{
895902
auto subscription = ev->Get()->Subscription;
896903
auto existing = InMemoryIndex.GetSubscription(subscription->Subscriber);
897904
if (existing == subscription) {
898-
InMemoryIndex.RemoveSubscription(subscription->Subscriber);
899-
ScheduledUpdates.erase(subscription->Subscriber);
900-
InflightUpdates.erase(subscription->Subscriber);
905+
RemoveSubscription(subscription->Subscriber);
901906

902907
Send(subscription->Subscriber, new TEvConsole::TEvConfigSubscriptionCanceled(subscription->Generation));
903908

ydb/core/cms/console/console_configs_provider.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ class TConfigsProvider : public TActorBootstrapped<TConfigsProvider> {
196196
const TActorContext &ctx);
197197

198198
void ProcessScheduledUpdates(const TActorContext &ctx);
199+
void RemoveSubscription(const TActorId& subscriber);
199200

200201
void Handle(NMon::TEvHttpInfo::TPtr &ev);
201202
void Handle(TEvConsole::TEvConfigSubscriptionRequest::TPtr &ev, const TActorContext &ctx);

0 commit comments

Comments
 (0)