Release shard lock earlier during delete workflow execution
@@ -955,6 +955,8 @@ func (s *ContextImpl) DeleteWorkflowExecution(
}
}()
+ // Wrap step 1 and 2 with function to release the lock with defer after step 2.
+ err = func() error {
s.wLock()
defer s.wUnlock()
@@ -998,6 +1000,9 @@ func (s *ContextImpl) DeleteWorkflowExecution(
RunID: key.RunID,
}
err = s.GetExecutionManager().DeleteCurrentWorkflowExecution(ctx, delCurRequest)
+ return err
+ }()
+
if err != nil {
return err
}
