diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-08 18:13:43 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-08 18:13:43 +0300 |
commit | 26b7ec2c6a7ffb01850dbecb0930b4f9412fe0f2 (patch) | |
tree | c9c8fdd391f97df8eea503a4ff21bb0b31ecb127 /sidekiq_cluster/sidekiq_cluster.rb | |
parent | 886ecba0bd2d964504b43303a39cfa2386f0feed (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'sidekiq_cluster/sidekiq_cluster.rb')
-rw-r--r-- | sidekiq_cluster/sidekiq_cluster.rb | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/sidekiq_cluster/sidekiq_cluster.rb b/sidekiq_cluster/sidekiq_cluster.rb index c3aa9e05a09..c5139ab8874 100644 --- a/sidekiq_cluster/sidekiq_cluster.rb +++ b/sidekiq_cluster/sidekiq_cluster.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true -require_relative 'dependencies' require_relative '../lib/gitlab/process_management' module Gitlab @@ -67,14 +66,19 @@ module Gitlab return end - pid = Process.spawn( - { 'ENABLE_SIDEKIQ_CLUSTER' => '1', - 'SIDEKIQ_WORKER_ID' => worker_id.to_s }, - *cmd, - pgroup: true, - err: $stderr, - out: $stdout - ) + # We need to remove Bundler specific env vars, since otherwise the + # child process will think we are passing an alternative Gemfile + # and will clear and reset LOAD_PATH. + pid = Bundler.with_original_env do + Process.spawn( + { 'ENABLE_SIDEKIQ_CLUSTER' => '1', + 'SIDEKIQ_WORKER_ID' => worker_id.to_s }, + *cmd, + pgroup: true, + err: $stderr, + out: $stdout + ) + end ProcessManagement.wait_async(pid) |