Reorder Sidekiq client middleware
What does this MR do?
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.
gitlab-com/gl-infra/scalability#268 (closed)
Screenshots
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
-
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Edited by Bob Van Landuyt