Skip to content

Optimise StuckCiJobsWorker

What does this MR do?

Fixes terrible performance that leads to SQL timeout: https://gitlab.com/gitlab-com/infrastructure/issues/3260.

The current query has multiple conditions and requires extensive DB access. The new outside/inside approach does indexed outside query to get IDs, and expensive inside query to perform filtering.

This code is already covered by tests of that worker.

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes https://gitlab.com/gitlab-com/infrastructure/issues/3260

Merge request reports

Loading