Skip to content

Moving cancelPendingPipeline to async worker

What does this MR do and why?

CancelPendingPipelines step in CreatePipelineService is taking too long to run synchronously.

Instead of running sync, we can move this CancelPendingPipeline step into a sidekiq worker to process async.

CancelPendingPipeline -> CancelPendingPipelineWorker -> CancelPendingPipelineService

Screenshots or screen recordings

Screenshot_2022-12-09_at_10.48.11_AM

Older pipelines that were in pending should be canceled when a newer pipeline runs.

New Screenshots of child pipeline canceled when new pipeline is queued

image

How to set up and validate locally

  1. Create a pipeline. This will get picked up pretty fast into a "Running State"
  2. Create another pipeline on same commit hash. This will be put into "Pending" depending on number of runners.
  3. Make a commit that updates the branch.
  4. The pipeline in step 2 should be canceled because it's outdated.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Feature Flag Rollout Issue:

#385099 (closed)

Related to #383156 (closed)

Edited by Max Fan

Merge request reports