Jobs with retry enabled get stuck after a failure

Summary

CI Runners do not pick up jobs instantiated after a failure when retry is enabled

Steps to reproduce

Create a job with retry: 3 and create a failing test. The second run sits there forever. Pausing and unpausing a runner fetches it and starts it running.

What is the current bug behavior?

Jobs created as a result of a failed job with a retry don't run when there are available runners.

What is the expected correct behavior?

Jobs should run when there are available runners

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info
System information
System:		Ubuntu 22.04
Current User:	git
Using RVM:	no
Ruby Version:	2.7.7p221
Gem Version:	3.1.6
Bundler Version:2.3.15
Rake Version:	13.0.6
Redis Version:	6.2.8
Sidekiq Version:6.5.7
Go Version:	unknown

GitLab information
Version:	15.7.5
Revision:	358d690d91c
Directory:	/opt/gitlab/embedded/service/gitlab-rails
DB Adapter:	PostgreSQL
DB Version:	12.12
URL:		https://my.gitlabinstall.com
HTTP Clone URL:	https://my.gitlabinstall.com/some-group/some-project.git
SSH Clone URL:	git@my.gitlabinstall.com:some-group/some-project.git
Using LDAP:	no
Using Omniauth:	yes
Omniauth Providers: saml

GitLab Shell
Version:	14.14.0
Repository storages:
- default: 	unix:/var/opt/gitlab/gitaly/gitaly.socket
GitLab Shell path:		/opt/gitlab/embedded/service/gitlab-shell

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 >= 14.14.0 ? ... OK (14.14.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Internal API available: OK Redis available via internal API: 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 (cluster/worker) ... 1/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 ...

Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Cable config exists? ... yes Resque config exists? ... 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 Systemd unit files or init script exist? ... skipped (omnibus-gitlab has neither init script nor systemd units) Systemd unit files or init script up-to-date? ... skipped (omnibus-gitlab has neither init script nor systemd units) Projects have namespace: ... 3/5 ... yes 14/67 ... yes 17/81 ... yes 46/86 ... yes 129/90 ... yes 28/96 ... yes 3/161 ... yes 3/163 ... yes 3/166 ... yes 3/178 ... yes 3/201 ... yes 46/205 ... yes 3/207 ... yes 3/209 ... yes 79/218 ... yes 5/232 ... yes 3/236 ... yes 3/237 ... yes 3/238 ... yes 3/239 ... yes 3/240 ... yes 3/241 ... yes 3/242 ... yes 3/243 ... yes 3/244 ... yes 3/245 ... yes 3/246 ... yes 3/248 ... yes 3/249 ... yes 3/250 ... yes 91/251 ... yes 91/259 ... yes 91/276 ... yes 91/284 ... yes 91/290 ... yes 3/292 ... yes 121/294 ... yes 121/295 ... yes 3/301 ... yes 3/305 ... yes 124/307 ... yes 81/308 ... yes 128/310 ... yes 3/311 ... yes 3/312 ... yes 130/314 ... yes 128/315 ... yes 135/316 ... yes 138/317 ... yes 3/318 ... yes 138/319 ... yes 3/320 ... yes 81/321 ... yes 142/322 ... yes 138/323 ... yes 143/324 ... yes 144/325 ... yes 145/326 ... yes 138/327 ... yes 138/328 ... yes 144/329 ... yes 3/330 ... yes 3/331 ... yes 146/334 ... yes 138/335 ... yes 3/336 ... yes 146/337 ... yes 138/339 ... yes 138/340 ... yes 138/343 ... yes 17/344 ... yes 148/346 ... yes 3/347 ... yes 144/348 ... yes 3/349 ... yes 3/350 ... yes 155/352 ... yes 155/353 ... yes 155/354 ... yes 146/355 ... yes 148/356 ... yes 155/357 ... yes 148/358 ... yes 160/359 ... yes 162/360 ... yes 163/361 ... yes 160/362 ... yes 163/363 ... yes 146/364 ... yes 163/365 ... yes 3/366 ... yes 167/367 ... yes 173/368 ... yes 167/370 ... yes 174/371 ... yes 160/372 ... yes 163/373 ... yes 167/374 ... yes 167/375 ... yes 176/376 ... yes 163/377 ... yes 167/378 ... yes 177/379 ... yes 163/380 ... yes 174/381 ... yes 174/382 ... yes 137/383 ... yes 3/384 ... yes 163/385 ... yes 3/386 ... yes 3/387 ... yes 174/388 ... yes 167/390 ... yes 81/391 ... yes 305/392 ... yes 308/393 ... yes Redis version >= 6.0.0? ... yes Ruby version >= 2.7.2 ? ... yes (2.7.7) Git user has default SSH configuration? ... yes Active users: ... 15 Is authorized keys file accessible? ... yes GitLab configured to store new projects in hashed storage? ... yes All projects are in hashed storage? ... yes

Checking GitLab App ... Finished

Checking GitLab subtasks ... Finished

Possible fixes