Skip to content
Snippets Groups Projects

Drop duplicate jobs from Sidekiq when enqueuing

All threads resolved!

What does this MR do?

This extends the UntilExecuting deduplication strategy to cancel scheduling jobs when they are already in the queue.

When we drop a job, we log that to the Sidekiq.logger

The log messages looks like this (for now):

I, [2020-03-05T11:50:24.765516 #67227]  INFO -- : {"class"=>"ProjectImportScheduleWorker", "retry"=>false, "queue"=>"project_import_schedule", :backtrace=>true, "jid"=>"474ddc7fd2ebecd467ef534e", "created_at"=>1583405424.761091, "enqueued_at"=>1583405424.764548, "meta.project"=>"gitlab-org/gitlab-shell", "meta.root_namespace"=>"gitlab-org", "meta.subscription_plan"=>"default", "correlation_id"=>"16e24e1b1696c7392de6a215d55d61bd", "duplicate-of"=>"ce57381d57ca6c4f671b3fab", "pid"=>67227, "job_status"=>"deduplicated", "message"=>"ProjectImportScheduleWorker JID-474ddc7fd2ebecd467ef534e: deduplicated: dropped until executing", "deduplication_type"=>"dropped until executing"}
I, [2020-03-05T11:50:24.768354 #67227]  INFO -- : {"class"=>"ProjectImportScheduleWorker", "retry"=>false, "queue"=>"project_import_schedule", :backtrace=>true, "jid"=>"0f744ea81107a95f8a648ac5", "created_at"=>1583405424.761091, "enqueued_at"=>1583405424.765619, "meta.project"=>"gnuwget/wget2", "meta.root_namespace"=>"gnuwget", "meta.subscription_plan"=>"default", "correlation_id"=>"3e9a45d693f927b5c119d25cdb8ed33d", "duplicate-of"=>"be79a0f45e3b145a56fccd86", "pid"=>67227, "job_status"=>"deduplicated", "message"=>"ProjectImportScheduleWorker JID-0f744ea81107a95f8a648ac5: deduplicated: dropped until executing", "deduplication_type"=>"dropped until executing"}

It is part of the work for gitlab-com/gl-infra/scalability#42.

We can't enable the feature yet until we've converted the sidekiq logger to a structured logger, and ingest it in the sidekiq index:

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Bob Van Landuyt

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Reviewer roulette

    Changes that require review have been detected! A merge request is normally reviewed by both a reviewer and a maintainer in its primary category (e.g. frontend or backend), and by a maintainer in all other categories.

    To spread load more evenly across eligible reviewers, Danger has randomly picked a candidate for each review slot. Feel free to override this selection if you think someone else would be better-suited, or the chosen person is unavailable.

    To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines.

    Once you've decided who will review this merge request, mention them as you normally would! Danger does not (yet?) automatically notify them for you.

    Category Reviewer Maintainer
    backend Arturo Herrero (@arturoherrero) James Lopez (@jameslopez)

    Generated by :no_entry_sign: Danger

    Edited by BobBot BobBot
  • Bob Van Landuyt mentioned in merge request !26586 (merged)

    mentioned in merge request !26586 (merged)

  • Thanks @reprazent, mostly looking good! Maybe we can clarify a bit further the logging strategy (left a question).

  • Bob Van Landuyt added 157 commits

    added 157 commits

    Compare with previous version

  • Author Maintainer

    Thanks @oswaldo, updated and replied. Another pass?

  • assigned to @oswaldo

  • Oswaldo Ferreira resolved all threads

    resolved all threads

  • Oswaldo Ferreira approved this merge request

    approved this merge request

  • Thanks @reprazent, the logging makes sense with !26586 (merged) explanations. LGTM :thumbsup:

  • Bob Van Landuyt changed the description

    changed the description

  • Author Maintainer

    Thanks @oswaldo! I've updated the method name.

    @jameslopez Would you have a moment for the maintainer review here?

  • Bob Van Landuyt resolved all threads

    resolved all threads

  • added 1 commit

    • 6a00a983 - Drop duplicate jobs from Sidekiq when enqueuing

    Compare with previous version

  • Bob Van Landuyt added 241 commits

    added 241 commits

    Compare with previous version

  • James Lopez
  • @reprazent thanks! LGTM :thumbsup:

  • James Lopez approved this merge request

    approved this merge request

  • James Lopez resolved all threads

    resolved all threads

  • James Lopez enabled an automatic merge when the pipeline for a6a7ee75 succeeds

    enabled an automatic merge when the pipeline for a6a7ee75 succeeds

  • merged

  • James Lopez mentioned in commit aee026f0

    mentioned in commit aee026f0

  • added workflowcanary label and removed workflowstaging label

  • added workflowproduction label and removed workflowcanary label

  • Please register or sign in to reply
    Loading