Race condition in auto-merging
Summary
It is possible to create an high-level race-condition in the auto-merging functionality leading to a blocked-merge request.
Steps to reproduce
Given Branch A and B, (e.g. both having one commit on top of master),
- It is requested to auto-merge branch A when pipeline succeed,
- It is requested to auto-merge branch B when pipeline succeed (almost at the same time as previous request).
- Pipeline for A does succeed and A is merged into master.
- Pipeline for B does succeed, but now master has changed, and B would need to be rebased but is not and stays in idle situation.
See screenshot.
What is the current bug behavior?
B is not automatically rebased in order to restart auto-merging. Also button for manually rebase is not available. Everything is green, yet nothing happens. Only thing possible (luckily) is to "Cancel automatic merge", but no explanation is given on why this is the only option.
What is the expected correct behavior?
Either automatically rebase, or, automatically cancelling the automatic merge with an explanation.
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Current User: git Using RVM: no Ruby Version: 2.4.4p296 Gem Version: 2.7.6 Bundler Version:1.16.2 Rake Version: 12.3.1 Redis Version: 3.2.11 Git Version: 2.18.0 Sidekiq Version:5.1.3 Go Version: unknownGitLab information Version: 11.3.0 Revision: 17bd59a Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: https:// HTTP Clone URL: https:///some-group/some-project.git SSH Clone URL: git@:some-group/some-project.git Using LDAP: no Using Omniauth: yes Omniauth Providers: gitlab, github
GitLab Shell Version: 8.3.3 Repository storage paths:
- default: /data/repo/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 Shell ...GitLab Shell version >= 8.3.3 ? ... OK (8.3.3) Repo base directory exists?
default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:root, or git:git? default... yes Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... 2/1 ... ok 4/2 ... ok 3/3 ... ok 4/4 ... ok 2/5 ... ok 4/6 ... ok 4/7 ... ok 4/8 ... ok 4/9 ... ok 3/10 ... ok 3/11 ... repository is empty 4/12 ... ok 4/13 ... ok 9/14 ... ok 17/15 ... ok 17/16 ... ok 4/17 ... ok 3/18 ... ok 4/19 ... ok 4/20 ... repository is empty 4/21 ... ok 22/22 ... ok 4/23 ... ok 4/24 ... ok 4/25 ... ok 4/26 ... ok 4/27 ... ok 4/28 ... ok 5/31 ... ok 22/32 ... ok 4/35 ... ok 4/36 ... ok 4/37 ... ok 32/38 ... ok 33/40 ... ok 4/41 ... ok 4/42 ... ok 4/43 ... ok 4/44 ... ok 17/45 ... ok 4/46 ... ok 4/47 ... repository is empty 22/48 ... ok 3/50 ... ok 5/52 ... repository is empty 4/54 ... ok 4/55 ... ok 17/56 ... ok 17/57 ... ok 17/58 ... ok 5/59 ... ok 55/62 ... repository is empty 56/63 ... ok 4/64 ... repository is empty 2/65 ... ok 22/66 ... ok 56/67 ... ok 56/68 ... ok 3/69 ... ok 3/70 ... ok 38/71 ... repository is empty 17/72 ... ok 17/73 ... ok 56/74 ... ok 17/75 ... ok 56/78 ... ok 56/79 ... repository is empty 17/80 ... ok 73/81 ... ok 73/82 ... ok 73/83 ... ok Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK
Redis available via internal API: OKAccess to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes Number of Sidekiq processes ... 1
Reply by email is disabled in config/gitlab.yml Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
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/1 ... yes 4/2 ... yes 3/3 ... yes 4/4 ... yes 2/5 ... yes 4/6 ... yes 4/7 ... yes 4/8 ... yes 4/9 ... yes 3/10 ... yes 3/11 ... yes 4/12 ... yes 4/13 ... yes 9/14 ... yes 17/15 ... yes 17/16 ... yes 4/17 ... yes 3/18 ... yes 4/19 ... yes 4/20 ... yes 4/21 ... yes 22/22 ... yes 4/23 ... yes 4/24 ... yes 4/25 ... yes 4/26 ... yes 4/27 ... yes 4/28 ... yes 5/31 ... yes 22/32 ... yes 4/35 ... yes 4/36 ... yes 4/37 ... yes 32/38 ... yes 33/40 ... yes 4/41 ... yes 4/42 ... yes 4/43 ... yes 4/44 ... yes 17/45 ... yes 4/46 ... yes 4/47 ... yes 22/48 ... yes 3/50 ... yes 5/52 ... yes 4/54 ... yes 4/55 ... yes 17/56 ... yes 17/57 ... yes 17/58 ... yes 5/59 ... yes 55/62 ... yes 56/63 ... yes 4/64 ... yes 2/65 ... yes 22/66 ... yes 56/67 ... yes 56/68 ... yes 3/69 ... yes 3/70 ... yes 38/71 ... yes 17/72 ... yes 17/73 ... yes 56/74 ... yes 17/75 ... yes 56/78 ... yes 56/79 ... yes 17/80 ... yes 73/81 ... yes 73/82 ... yes 73/83 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.5 ? ... yes (2.4.4) Git version >= 2.9.5 ? ... yes (2.18.0) Git user has default SSH configuration? ... yes Active users: ... 58
Checking GitLab ... Finished