Needs keyword can cause deadlocks on pipeline retries

Summary

After I started using the 'needs' keyword on my pipelines at https://gitlab.com/racket/racket, I started noticing that upon failure (irrelevant the type of failure), attempting to retry the pipeline got it deadlocked.

Steps to reproduce

Example pipeline waiting to execute for 3 days - https://gitlab.com/racket/racket/pipelines/89937658

Example Project

https://gitlab.com/racket/racket

What is the current bug behaviour?

Retry on pipeline starts previously failed jobs. But if a job that is about to be retried depends on (needs) a job which completed successfully in a previous run, the job never actually starts.

What is the expected correct behaviour?

Job that's about to be retried noticed that dependencies were successful and starts straight away.

Results of GitLab environment info

gitlab.com

Assignee Loading
Time tracking Loading