Auto-cancel pending pipelines

Summary

(Not able to prevent multiple pipelines to be executed in parallel)

Steps to reproduce

(Create new gitlab project 1- Turned on “Auto-cancel redundant, pending pipelines” from the CICD pipeline setting for this project. 2- Keep commit the changes or keep clicking on “Run Pipeline” button multiple times 3- Make sure that you have multiple shared runners (I have 50 shared runners) 4- Expectation Only one pipeline to run at a time All redundant pipeline should be auto canceled and only the last pipeline will be in the queue

5- Actual behavior None of the pipelines are canceled. All pipelines are executed

Example Project

stages:

  • build
  • test
  • stage

before_script: - env | sort - pwd - ls -la

build: stage: build image: "paciolanadmin/maven-jdk-alpine" script: - echo "Starting building...." - sleep 50 - echo "Done"

test: stage: test image: "paciolanadmin/maven-jdk-alpine" script: - echo "Starting deploying to test..." - sleep 50 - echo "Done"

stage: stage: stage image: "paciolanadmin/maven-jdk-alpine" script: - echo "Starting deploying to stage..." - sleep 50 - echo "Done" when: manual

What is the current bug behavior?

None of the pipelines are canceled. All pipelines are executed

What is the expected correct behavior?

Only one pipeline to run at a time All redundant pipeline should be auto canceled and only the last pipeline will be in the queue

Relevant logs and/or screenshots

(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's very hard to read otherwise.)

Output of checks

(If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com)

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:env:info)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

(If you can, link to the line of code that might be responsible for the problem)