Skip to content

Change defer_sidekiq_jobs FF delimiter to _

What does this MR do and why?

Change defer_sidekiq_jobs FF delimiter to _

The delimiter of : does not work well in Slack because it could be converted to emoji, e.g. :Gitlab::xxx or :Chaos::xxx. This makes managing the feature flag via ChatOps unusable.

Changelog: changed

Check this comment for more context: gitlab-com/gl-infra/scalability#2347 (comment 1399297375)


This feature flag was introduced in !120606 (merged) to allow us to defer sidekiq jobs during an incident (without manually running rake tasks / console commands).

How to set up and validate locally

  1. Check out this branch and restart Sidekiq process

  2. In Rails console, enable the feature flag Feature.enable(:"defer_sidekiq_jobs_Chaos::SleepWorker")

  3. Check that the feature flag is enabled

    [14] pry(main)> Feature.enabled?(:"defer_sidekiq_jobs_Chaos::SleepWorker", type: :worker, default_enabled_if_undefined: false)
    => true
  4. Clear the ScheduledSet jobs Sidekiq::ScheduledSet.new.clear

  5. Run the worker Chaos::SleepWorker.perform_async(1)

  6. Check that the job is now in the ScheduledSet

    [26] pry(main)> Sidekiq::ScheduledSet.new.entries
    => [#<Sidekiq::SortedEntry:0x000000012b711e58
      @args=nil,
      @item=
       {"retry"=>3,
        "queue"=>"default",
        "backtrace"=>true,
        "version"=>0,
        "queue_namespace"=>"chaos",
        "class"=>"Chaos::SleepWorker",
        "args"=>[1],
        "jid"=>"fbaa1109d7d85fbe4c56d991",
        "created_at"=>1684751642.898051,
        "correlation_id"=>"112a79778a43675422559409ba15ce83",
        "meta.caller_id"=>"Chaos::SleepWorker",
        "meta.feature_category"=>"not_owned",
        "meta.root_caller_id"=>"Chaos::SleepWorker",
        "worker_data_consistency"=>"always",
        "size_limiter"=>"validated",
        "scheduled_at"=>1684751942.8980029},
      @parent=#<Sidekiq::ScheduledSet:0x000000012b7183e8 @_size=1, @name="schedule">,
      @queue="default",
      @score=1684751942.8980029,
      @value=
       "{\"retry\":3,\"queue\":\"default\",\"backtrace\":true,\"version\":0,\"queue_namespace\":\"chaos\",\"class\":\"Chaos::SleepWorker\",\"args\":[1],\"jid\":\"fbaa1109d7d85fbe4c56d991\",\"created_at\":1684751642.898051,\"correlation_id\":\"112a79778a43675422559409ba15ce83\",\"meta.caller_id\":\"Chaos::SleepWorker\",\"meta.feature_category\":\"not_owned\",\"meta.root_caller_id\":\"Chaos::SleepWorker\",\"worker_data_consistency\":\"always\",\"size_limiter\":\"validated\",\"scheduled_at\":1684751942.8980029}">]

MR acceptance checklist

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

Edited by Gregorius Marco

Merge request reports

Loading