• Bob Van Landuyt's avatar
    Reorder Sidekiq client middleware · a37544ab
    Bob Van Landuyt authored
    The new order is as follows:
    
    - ::Gitlab::SidekiqMiddleware::WorkerContext::Client
      Context for batch jobs
    - ::Labkit::Middleware::Sidekiq::Client
      Serialize the context into the job hash
    - ::Gitlab::SidekiqMiddleware::DuplicateJobs::Client
      Drop the job if needed
    - ::Gitlab::SidekiqStatus::ClientMiddleware
      Keep track of the status of the job
    - ::Gitlab::SidekiqMiddleware::AdminMode::Client
      Run the job with elevated permissions or not
    - ::Gitlab::SidekiqMiddleware::ClientMetrics
      Count the enqueued job
    
    This makes sure we add the logging information in the beginning of the
    chain, as it could be needed for log messages coming form the other
    middlewares.
    
    Next we're doing deduplication, so we can skip any other work that
    might not be needed.
    
    The last step are the metrics, which counts enqueued jobs, this makes
    sure that if anything happens in the chain, we don't count an enqueued
    job. If that middleware is before the deduplication, count jobs that
    might be dropped as enqueued.
    a37544ab
sidekiq_middleware.rb 2.01 KB