Skip to content

limit parameter in runner config.toml is ignored

Status update: 2024-06-06

Hey folks, we recently retested it on MacOS M1 and GitLab Runner 17.0.0 and we could not reproduce the bug described. The pair limit/concurrency was behaving as expected.

If you come across this issue because you have experienced this problem, please open a new issue in this project 🙇🏿

The following scenarios were tested :

  • Parallel jobs (set to 5 for each branch) on two different branches of the same repo using the following config.toml
config.toml
concurrent = 5
check_interval = 0
shutdown_timeout = 0
log_level = "debug"

[session_server]
  session_timeout = 1800

[[runners]]
  name = "touni-mbp"
  url = "https://gitlab.com/"
  limit = 3
  id = 36356464
  token = "glrt-REDACTED"
  token_obtained_at = 2024-05-07T16:42:27Z
  token_expires_at = 0001-01-01T00:00:00Z
  executor = "shell"
  [runners.custom_build_dir]
  [runners.cache]
    MaxUploadedArchiveSize = 0
    [runners.cache.s3]
    [runners.cache.gcs]
    [runners.cache.azure]
  • Parallel jobs (set to 5) on one different branch of the same repo using the following config.toml
config.toml
concurrent = 1
check_interval = 0
shutdown_timeout = 0
log_level = "debug"

[session_server]
  session_timeout = 1800

[[runners]]
  name = "touni-mbp"
  url = "https://gitlab.com/"
  limit = 1
  id = 36356464
  token = "glrt-REDACTED"
  token_obtained_at = 2024-05-07T16:42:27Z
  token_expires_at = 0001-01-01T00:00:00Z
  executor = "shell"
  [runners.custom_build_dir]
  [runners.cache]
    MaxUploadedArchiveSize = 0
    [runners.cache.s3]
    [runners.cache.gcs]
    [runners.cache.azure]

Original issue Summary

limit parameter in runner config.toml is ignored whilst using the following config file and .gitlab-ci.yaml file, I get multiple jobs running in parallel on the same runner in spite of defining the 'limit' parameter on my runner.

Steps to reproduce

Use the following config.toml and gitlab-ci.yaml and the stage 'test' will run multiple times in parallel.

$ cat ~/.gitlab-runner/config.toml
concurrent = 1
check_interval = 0

[[runners]]
  name = "ios-gitlab-ci"
  url = "redacted"
  token = "redacted"
  executor = "shell"
  limit = 1
  [runners.cache]


$ cat .gitlab-ci.yml
stages:
  - nightly
  - test
  - beta

before_script:
  - source /usr/local/share/chruby/chruby.sh
  - chruby ruby 2.3.1
  - export PATH=$PATH:/usr/local/bin

deploy_nightly:
  stage: nightly
  only:
    - development
  script:
    - ./jenkins.sh
  tags:
    - ios

test_project:
  stage: test
  script:
    - fastlane test
  tags:
    - ios
  artifacts:
    paths:
        - ./test-output/*
    when: always

deploy_beta:
  stage: beta
  only:
    - /^release_.*$/
    - tags
  except:
    - branches
  script:
    - fastlane beta


variables:
    FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: "60"

Actual behavior

More than one job will run at once. Because this happens in the same git working copy, all parallel running builds will break each other resulting in me having to limit all jobs to a single git branch in order to have a function Gitlab CI

Expected behavior

Jobs should be listed as pending whilst only a single job per runner executes.

Relevant logs and/or screenshots

Screen_Shot_2017-07-18_at_9.20.15_PM

Environment description

The runner in question is a specific runner locked to a specific project. The runner is running in user mode on MacOS 10.12.5

Gitlab: GitLab Enterprise Edition 9.2.2-ee b004167

Used GitLab Runner version

gitlab-runner:

$ gitlab-runner --version
Version:      9.3.0
Git revision: 3df822b
Git branch:   9-3-stable
GO version:   go1.7.5
Built:        Thu, 22 Jun 2017 10:57:56 +0000
OS/Arch:      darwin/amd64