Skip to content

Move updating older-statuses-retried before enqueueing

Furkan Ayhan requested to merge 326791-eliminate-race-condition into master

What does this MR do?

Related to #326791 (closed)

We are trying to eliminate the usage of Ci::ProcessPipelineService#update_retried. However, we see that there is still small amount usage =>

Screen_Shot_2021-04-09_at_18.44.54

Fabio realized that this may be because of a race condition. In Projects::UpdatePagesService, we run @status.enqueue! and @status.run! before our new method @status.update_older_statuses_retried!. Those may trigger PipelineProcessWorker before our new method.

In this MR, I am moving @status.update_older_statuses_retried! to the top.


It is also annoying to see that we do first @status.enqueue!, then @status.run!. And each of them actually enqueues PipelineProcessWorker. However, it is out of scope from this MR.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Merge request reports

Loading