Runners are pending for a while
Summary
Not a bug but could not find a better tag: I use self-hosted Gitlab CI with a VPS running the Gitlab instance and another VPS running runners. There are several runners registered, all running on that same VPS but I'm the sole user and concurrency is set 1, ie each job one after another.
All works well, all my jobs are ran properly and generally everything behaves as expected except for one thing: even though no job is being processed and no runners is already in use, the time before a new job is picked varies a lot.
It can be several minutes before a job is picked, up to 10-15mn. And sometimes a new job is picked instantly as it should (because there's no other job being processed by any runner).
Jobs are usually short, less than a minute in all cases. They either succeed or fail but I never have stuck jobs. Despite that, I sometimes have to wait 10 mn before a new job is picked up. It's like the previous job did not report that it ended and the runner is available again. Except it did report and the previous job is marked as either success or failure.
I feel I'm missing something configuration-wise. Project timeout is 1h, there's no runner-specific timeout set.
Any idea why that would happen, where I should look for a hint as to how to solve this?
Many thanks
Steps to reproduce
Not sure this can be reproduced.
What is the current bug behavior?
Most times a new job has to wait several minutes, up to 10-15mn to be picked despite all runners being available. For instance no job has been ran for the last 24 hours and the 1st job waits for 10mn in a pending state. Subsequent jobs wait also for various amounts of times, sometimes it's instant.
What is the expected correct behavior?
A new job should be picked up instantly assuming a runner is available.
Results of GitLab environment info
Expand for output related to GitLab environment info
System: Debian 9.8 Current User: git Using RVM: no Ruby Version: 2.5.3p105 Gem Version: 2.7.6 Bundler Version:1.16.6 Rake Version: 12.3.2 Redis Version: 3.2.12 Git Version: 2.18.1 Sidekiq Version:5.2.5 Go Version: unknown
GitLab information Version: 11.8.0 Revision: ce13864 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: https://xxx.example.com HTTP Clone URL: https://xxx.example.com/some-group/some-project.git SSH Clone URL: git@xxx.example.com:some-group/some-project.git Using LDAP: no Using Omniauth: yes Omniauth Providers:
GitLab Shell Version: 8.4.4 Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab subtasks ...Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 8.4.4 ? ... OK (8.4.4) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Gitaly ...
Gitaly: ... default ... OK
Checking Gitaly ... Finished
Checking Sidekiq ...
Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Incoming Email ...
Incoming Email: ... Reply by email is disabled in config/gitlab.yml
Checking Incoming Email ... Finished
Checking LDAP ...
LDAP: ... LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab App ...
Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 2/3 ... yes 2/4 ... yes 2/5 ... yes 2/6 ... yes 2/7 ... yes 9/8 ... yes 2/9 ... yes 2/10 ... yes 2/11 ... yes 2/12 ... yes 2/13 ... yes 2/14 ... yes 2/15 ... yes 2/16 ... yes 2/17 ... yes 2/18 ... yes 2/19 ... yes 2/20 ... yes 2/21 ... yes 2/22 ... yes 2/23 ... yes 2/24 ... yes 2/25 ... yes 2/26 ... yes 2/27 ... yes 2/28 ... yes 2/29 ... yes 2/30 ... yes 2/31 ... yes 2/32 ... yes 2/33 ... yes 2/34 ... yes 2/35 ... yes 2/36 ... yes 2/37 ... yes 2/38 ... yes 2/40 ... yes 2/41 ... yes 2/42 ... yes 2/43 ... yes 2/44 ... yes 2/46 ... yes 7/47 ... yes 2/48 ... yes 2/49 ... yes 2/50 ... yes 2/51 ... yes 2/52 ... yes 2/53 ... yes 2/54 ... yes 9/56 ... yes 2/57 ... yes 10/58 ... yes 10/59 ... yes 3/60 ... yes 11/61 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.5 ? ... yes (2.5.3) Git version >= 2.18.0 ? ... yes (2.18.1) Git user has default SSH configuration? ... yes Active users: ... 2
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished