Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-20 21:09:31 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-20 21:09:31 +0300
commitae4ef81757bdd2c984777d8f0b2c275bbcb4b17d (patch)
tree1ac23c80190bafb47a1f5a6f1aae9da91d35d9dc /app/workers/concerns
parent194b499aa8e26df26ff70a1e1ce0396587bd5243 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/workers/concerns')
-rw-r--r--app/workers/concerns/waitable_worker.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/workers/concerns/waitable_worker.rb b/app/workers/concerns/waitable_worker.rb
index f995aced542..b9ea585d49b 100644
--- a/app/workers/concerns/waitable_worker.rb
+++ b/app/workers/concerns/waitable_worker.rb
@@ -9,6 +9,15 @@ module WaitableWorker
# Short-circuit: it's more efficient to do small numbers of jobs inline
return bulk_perform_inline(args_list) if args_list.size <= 3
+ # Don't wait if there's too many jobs to be waited for. Not including the
+ # waiter allows them to be deduplicated and it skips waiting for jobs that
+ # are not likely to finish within the timeout. This assumes we can process
+ # 10 jobs per second:
+ # https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/205
+ if ::Feature.enabled?(:skip_job_waiter_for_large_batches)
+ return bulk_perform_async(args_list) if args_list.length >= 10 * timeout
+ end
+
waiter = Gitlab::JobWaiter.new(args_list.size, worker_label: self.to_s)
# Point all the bulk jobs at the same JobWaiter. Converts, [[1], [2], [3]]