summaryrefslogtreecommitdiff
path: root/app/workers/issue_placement_worker.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/workers/issue_placement_worker.rb')
-rw-r--r--app/workers/issue_placement_worker.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/workers/issue_placement_worker.rb b/app/workers/issue_placement_worker.rb
index 5b547ab0c8d..dba791c3f05 100644
--- a/app/workers/issue_placement_worker.rb
+++ b/app/workers/issue_placement_worker.rb
@@ -3,7 +3,10 @@
class IssuePlacementWorker
include ApplicationWorker
+ sidekiq_options retry: 3
+
idempotent!
+ deduplicate :until_executed, including_scheduled: true
feature_category :issue_tracking
urgency :high
worker_resource_boundary :cpu
@@ -17,6 +20,10 @@ class IssuePlacementWorker
issue = find_issue(issue_id, project_id)
return unless issue
+ # Temporary disable moving null elements because of performance problems
+ # For more information check https://gitlab.com/gitlab-com/gl-infra/production/-/issues/4321
+ return if issue.blocked_for_repositioning?
+
# Move the oldest 100 unpositioned items to the end.
# This is to deal with out-of-order execution of the worker,
# while preserving creation order.
@@ -30,7 +37,7 @@ class IssuePlacementWorker
leftover = to_place.pop if to_place.count > QUERY_LIMIT
Issue.move_nulls_to_end(to_place)
- Issues::BaseService.new(nil).rebalance_if_needed(to_place.max_by(&:relative_position))
+ Issues::BaseService.new(project: nil).rebalance_if_needed(to_place.max_by(&:relative_position))
IssuePlacementWorker.perform_async(nil, leftover.project_id) if leftover.present?
rescue RelativePositioning::NoSpaceLeft => e
Gitlab::ErrorTracking.log_exception(e, issue_id: issue_id, project_id: project_id)