Skip to content

Improve unlock pipelines worker logging

Erick Bajao requested to merge eb-improve-unlock-pipeline-worker-logging into master

As we were observing the logs for #415503 (closed), we realize we were lacking visibility on which specific pipelines were being unlocked in cases wherein the limited capacity worker would fail due to an exception.

This MR changes the logging order of pipeline ID and project, and also changes the Gitlab::SidekiqMiddleware::ExtraDoneLogMetadata to also log the logging_extras even on job failures due to errors.

How to test locally

  1. Make sure to enable the ci_unlock_pipelines_queue and ci_unlock_pipelines flags.
  2. On a sample project that generates an artifact, run a pipeline. This first pipeline will then be locked.
  3. Then before we run another pipeline, we want to temporarily force an error on the Ci::UnlockPipelineService.
    • def execute
        raise 'dummy error!' # Add this line
        unlock_pipeline_exclusively
        ...
      end
  4. Restart GDK and then run another pipeline so we can check the previous pipeline to be unlocked.
  5. Go to http://gdk.test:3000/admin/sidekiq/cron, and manually enqueue ci_schedule_unlock_pipelines_in_queue_worker.
  6. Observe tail -f log/sidekiq.log and see the payload should include extra.ci_unlock_pipelines_in_queue_worker.pipeline_id and extra.ci_unlock_pipelines_in_queue_worker.project of the 1st pipeline that was supposed to be unlock.
Edited by Erick Bajao

Merge request reports

Loading