diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-12 15:09:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-12 15:09:15 +0300 |
commit | d7fd035dc387e9c2e5c31bbb53d867239689cfbf (patch) | |
tree | cfa2a19998e4743be51c987f200495d80a4c4466 /lib | |
parent | ede2fbdc8734f095d371614d362b5ae373d6a243 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ci/pipeline/chain/helpers.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/gitlab/ci/pipeline/chain/helpers.rb b/lib/gitlab/ci/pipeline/chain/helpers.rb index d7271df1694..f995f62f87b 100644 --- a/lib/gitlab/ci/pipeline/chain/helpers.rb +++ b/lib/gitlab/ci/pipeline/chain/helpers.rb @@ -12,7 +12,17 @@ module Gitlab end pipeline.add_error_message(message) - pipeline.drop!(drop_reason) if drop_reason && persist_pipeline? + + if drop_reason && persist_pipeline? + if Feature.enabled?(:ci_pipeline_ensure_iid_on_drop, pipeline.project, default_enabled: :yaml) + # 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 drop! call + # which it will lock the InternalId row for the whole transaction + pipeline.ensure_project_iid! + end + + pipeline.drop!(drop_reason) + end # TODO: consider not to rely on AR errors directly as they can be # polluted with other unrelated errors (e.g. state machine) |