From 4a447225921bc445856521641b1338d6857e493d Mon Sep 17 00:00:00 2001 From: Julien Perrochet Date: Thu, 12 Sep 2024 16:36:51 +0200 Subject: [PATCH] [dss/SCD] early subscription lock for OIR deletions --- pkg/scd/operational_intents_handler.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/scd/operational_intents_handler.go b/pkg/scd/operational_intents_handler.go index 86b8732e5..fab693655 100644 --- a/pkg/scd/operational_intents_handler.go +++ b/pkg/scd/operational_intents_handler.go @@ -99,6 +99,13 @@ func (a *Server) DeleteOperationalIntentReference(ctx context.Context, req *rest "Current version is %s but client specified version %s", old.OVN, ovn) } + // Early lock on the subscriptions covering the cells relevant to the OIR + // See issue #1002 for details. + err = r.LockSubscriptionsOnCells(ctx, old.Cells) + if err != nil { + return stacktrace.Propagate(err, "Unable to acquire lock") + } + // Get the Subscription supporting the OperationalIntent, if one is defined var previousSubscription *scdmodels.Subscription if old.SubscriptionID != nil {