From 103c4053390dd05af5f97c608ed81d196225f933 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Thu, 21 Apr 2016 14:49:15 +0200 Subject: [PATCH 1/2] Use SIGTERM during Sidekiq memory shutdown This makes the memory killer behave more like 'sidekiqctl stop'. --- lib/gitlab/sidekiq_middleware/memory_killer.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/gitlab/sidekiq_middleware/memory_killer.rb b/lib/gitlab/sidekiq_middleware/memory_killer.rb index 37232743325..ae85b294d31 100644 --- a/lib/gitlab/sidekiq_middleware/memory_killer.rb +++ b/lib/gitlab/sidekiq_middleware/memory_killer.rb @@ -29,8 +29,8 @@ module Gitlab "in #{GRACE_TIME} seconds" sleep(GRACE_TIME) - Sidekiq.logger.warn "sending SIGUSR1 to PID #{Process.pid}" - Process.kill('SIGUSR1', Process.pid) + Sidekiq.logger.warn "sending SIGTERM to PID #{Process.pid}" + Process.kill('SIGTERM', Process.pid) Sidekiq.logger.warn "waiting #{SHUTDOWN_WAIT} seconds before sending "\ "#{SHUTDOWN_SIGNAL} to PID #{Process.pid}" From 42567436863c96b7f184cc7a728b2da3d18852c8 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Fri, 22 Apr 2016 12:18:11 +0200 Subject: [PATCH 2/2] refactored path stuff --- lib/gitlab/import_export.rb | 4 +--- lib/gitlab/import_export/saver.rb | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/gitlab/import_export.rb b/lib/gitlab/import_export.rb index fe88850c33d..539eae13f33 100644 --- a/lib/gitlab/import_export.rb +++ b/lib/gitlab/import_export.rb @@ -3,7 +3,7 @@ module Gitlab extend self def export_path(relative_path:) - File.join(storage_path, relative_path, "#{Time.now.strftime('%Y-%m-%d_%H-%M-%3N')}_gitlab_export") + File.join(storage_path, relative_path) end def project_atts @@ -14,8 +14,6 @@ module Gitlab Gitlab::ImportExport::ImportExportReader.project_tree end - private - def storage_path File.join(Settings.shared['path'], 'tmp/project_exports') end diff --git a/lib/gitlab/import_export/saver.rb b/lib/gitlab/import_export/saver.rb index f26804d2402..f87e0fdc7ea 100644 --- a/lib/gitlab/import_export/saver.rb +++ b/lib/gitlab/import_export/saver.rb @@ -31,7 +31,7 @@ module Gitlab end def archive_file - @archive_file ||= File.join(@storage_path, '..', 'project.tar.gz') + @archive_file ||= File.join(@storage_path, '..', "#{Time.now.strftime('%Y-%m-%d_%H-%M-%3N')}_project_export.tar.gz") end end end