Skip to content
Snippets Groups Projects
Unverified Commit 5e7f54b8 authored by Stan Hu's avatar Stan Hu Committed by GitLab
Browse files

Merge branch 'sc1-optimize-concurrency-tracking' into 'master'

Track worker concurrency using Redis hash - 2nd try

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169561



Merged-by: default avatarStan Hu <stanhu@gmail.com>
Approved-by: default avatarDmitry Gruzd <dgruzd@gitlab.com>
Approved-by: default avatarStan Hu <stanhu@gmail.com>
Reviewed-by: default avatarDmitry Gruzd <dgruzd@gitlab.com>
Reviewed-by: default avatarSylvester Chin <schin@gitlab.com>
Co-authored-by: default avatarSylvester Chin <schin@gitlab.com>
parents c074d05e aab064e9
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -11,8 +11,13 @@ def gitlab_sidekiq_inline
# see https://github.com/sidekiq/sidekiq/issues/6069
Sidekiq::Testing.inline!
 
# Set a thread-local sidekiq capsule as it may be accessed in the
# Gitlab::SidekiqMiddleware::ConcurrencyLimit::WorkerExecutionTracker
Thread.current[:sidekiq_capsule] = Sidekiq::Capsule.new('test', Sidekiq.default_configuration)
yield
ensure
Thread.current[:sidekiq_capsule] = nil
Sidekiq::Testing.fake! # fake is the default so we reset it to that
redis_queues_cleanup!
redis_queues_metadata_cleanup!
Loading
Loading
Loading
Loading
@@ -24,6 +24,6 @@ def self.name
limit = 55
expect(Search).to receive(:default_concurrency_limit).and_return(limit)
 
expect(Gitlab::SidekiqMiddleware::ConcurrencyLimit::WorkersMap.limit_for(worker: worker_class)&.call).to eq(limit)
expect(Gitlab::SidekiqMiddleware::ConcurrencyLimit::WorkersMap.limit_for(worker: worker_class)).to eq(limit)
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment