@@ -561,6 +561,12 @@ void TConfigsProvider::ProcessScheduledUpdates(const TActorContext &ctx)
561
561
*Counters.InflightConfigUpdates = InflightUpdates.size ();
562
562
}
563
563
564
+ void TConfigsProvider::RemoveSubscription (const TActorId& subscriber) {
565
+ InMemoryIndex.RemoveSubscription (subscriber);
566
+ ScheduledUpdates.erase (subscriber);
567
+ InflightUpdates.erase (subscriber);
568
+ }
569
+
564
570
void TConfigsProvider::CheckSubscription (TSubscription::TPtr subscription,
565
571
const TActorContext &ctx)
566
572
{
@@ -829,7 +835,7 @@ void TConfigsProvider::Handle(TEvConsole::TEvConfigSubscriptionRequest::TPtr &ev
829
835
return ;
830
836
}
831
837
832
- InMemoryIndex. RemoveSubscription (subscriber);
838
+ RemoveSubscription (subscriber);
833
839
Send (existing->Worker , new TEvents::TEvPoisonPill ());
834
840
}
835
841
@@ -886,18 +892,17 @@ void TConfigsProvider::Handle(TEvConsole::TEvConfigSubscriptionCanceled::TPtr &e
886
892
887
893
Y_ABORT_UNLESS (subscription->Worker );
888
894
889
- InMemoryIndex. RemoveSubscription (subscriber);
895
+ RemoveSubscription (subscriber);
890
896
Send (subscription->Worker , new TEvents::TEvPoisonPill ());
897
+ ProcessScheduledUpdates (ctx);
891
898
}
892
899
893
900
void TConfigsProvider::Handle (TEvPrivate::TEvWorkerDisconnected::TPtr &ev, const TActorContext &ctx)
894
901
{
895
902
auto subscription = ev->Get ()->Subscription ;
896
903
auto existing = InMemoryIndex.GetSubscription (subscription->Subscriber );
897
904
if (existing == subscription) {
898
- InMemoryIndex.RemoveSubscription (subscription->Subscriber );
899
- ScheduledUpdates.erase (subscription->Subscriber );
900
- InflightUpdates.erase (subscription->Subscriber );
905
+ RemoveSubscription (subscription->Subscriber );
901
906
902
907
Send (subscription->Subscriber , new TEvConsole::TEvConfigSubscriptionCanceled (subscription->Generation ));
903
908
0 commit comments