summaryrefslogtreecommitdiff
path: root/lib/gitlab/ci/pipeline/chain/skip.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/ci/pipeline/chain/skip.rb')
-rw-r--r--lib/gitlab/ci/pipeline/chain/skip.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/gitlab/ci/pipeline/chain/skip.rb b/lib/gitlab/ci/pipeline/chain/skip.rb
index df92e229f12..e4e4f4f484a 100644
--- a/lib/gitlab/ci/pipeline/chain/skip.rb
+++ b/lib/gitlab/ci/pipeline/chain/skip.rb
@@ -11,7 +11,14 @@ module Gitlab
def perform!
if skipped?
- @pipeline.skip if @command.save_incompleted
+ if @command.save_incompleted
+ # Project iid must be called outside a transaction, so we ensure it is set here
+ # otherwise it may be set within the state transition transaction of the skip call
+ # which it will lock the InternalId row for the whole transaction
+ @pipeline.ensure_project_iid!
+
+ @pipeline.skip
+ end
end
end