GitLab CI "interruptible" Not Cancelling Redundant Pipelines
interruptible: true lets GitLab auto-cancel a running pipeline when a newer commit supersedes it. It stops working once a non-interruptible job has started, or when the project auto-cancel setting is disabled.
What this error means
Pushing a new commit does not cancel the older still-running pipeline, so redundant pipelines pile up and waste runner minutes - even though jobs are marked interruptible.
# New commit pushed, but the previous pipeline keeps running.
test:
interruptible: true
script: make test
deploy:
script: make deploy # NOT interruptible -> locks the whole pipelineDiagnose it: which rule matched, and on which runner?
GitLab evaluates rules: top to bottom and the first match wins, including one that sets when: never. A job that does not run, or runs when you did not expect it to, is nearly always matching an earlier rule than the one you are reading.
# validate the definition against the project
curl -s --header "PRIVATE-TOKEN: $TOKEN" \
"https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/ci/lint" \
--data-urlencode "content=$(cat .gitlab-ci.yml)"
# what the job actually sees
script:
- env | grep -E "^CI_(PIPELINE_SOURCE|COMMIT_REF_NAME|RUNNER)" | sortCommon causes
A non-interruptible job already started
Once any job without interruptible: true begins running, GitLab will no longer auto-cancel that pipeline - the whole pipeline becomes non-interruptible from that point.
Auto-cancel-redundant setting disabled
Auto-cancellation of redundant pipelines is a project CI/CD setting. If it is off, interruptible has no effect regardless of how jobs are marked.
How to fix it
Mark early jobs interruptible, gate deploys
Keep build/test interruptible and make irreversible jobs (deploys) manual or late so they do not start before cancellation can happen.
default:
interruptible: true # applies to all jobs by default
deploy:
interruptible: false # protect a real deployment from cancellation
when: manual
script: make deployEnable auto-cancel in project settings
- Open Settings → CI/CD → General pipelines.
- Enable "Auto-cancel redundant pipelines".
- Confirm early jobs are
interruptibleso a newer commit cancels the older pipeline before deploy starts.
How to prevent it
- Set
interruptible: trueviadefault:for build/test jobs. - Keep irreversible jobs (deploy/release) non-interruptible and gated.
- Enable auto-cancel redundant pipelines at the project level.