From 4a62a11f20dc109b0976b76a8f8e6d0b2ab35353 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Tue, 5 Jul 2016 16:58:42 +0200 Subject: [PATCH 1/3] add more debug info to project export --- app/services/projects/import_export/export_service.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/services/projects/import_export/export_service.rb b/app/services/projects/import_export/export_service.rb index 3f507d5c40..6afc048576 100644 --- a/app/services/projects/import_export/export_service.rb +++ b/app/services/projects/import_export/export_service.rb @@ -38,6 +38,8 @@ module Projects end def cleanup_and_notify + Rails.logger.error("Import/Export - Project #{project.name} with ID: #{project.id} export error - #{@shared.errors.join(', ')}") + FileUtils.rm_rf(@shared.export_path) notify_error @@ -45,6 +47,8 @@ module Projects end def notify_success + Rails.logger.info("Import/Export - Project #{project.name} with ID: #{project.id} successfully exported") + notification_service.project_exported(@project, @current_user) end From 95f630daeb5eec330080095786f7ac6702ebcc3f Mon Sep 17 00:00:00 2001 From: James Lopez Date: Wed, 6 Jul 2016 10:29:31 +0200 Subject: [PATCH 2/3] even more debug --- lib/gitlab/import_export/command_line_util.rb | 3 ++- lib/gitlab/import_export/saver.rb | 1 + lib/gitlab/sidekiq_middleware/memory_killer.rb | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/gitlab/import_export/command_line_util.rb b/lib/gitlab/import_export/command_line_util.rb index 78664f076e..3d0b23710c 100644 --- a/lib/gitlab/import_export/command_line_util.rb +++ b/lib/gitlab/import_export/command_line_util.rb @@ -28,7 +28,8 @@ module Gitlab end def execute(cmd) - _output, status = Gitlab::Popen.popen(cmd) + output, status = Gitlab::Popen.popen(cmd) + @shared.error(output.to_s) unless status_zero? status.zero? end diff --git a/lib/gitlab/import_export/saver.rb b/lib/gitlab/import_export/saver.rb index f38229c6c5..dd4fdf3730 100644 --- a/lib/gitlab/import_export/saver.rb +++ b/lib/gitlab/import_export/saver.rb @@ -17,6 +17,7 @@ module Gitlab Rails.logger.info("Saved project export #{archive_file}") archive_file else + @shared.error("Unable to save #{archive_file} into #{@shared.export_path}") false end rescue => e diff --git a/lib/gitlab/sidekiq_middleware/memory_killer.rb b/lib/gitlab/sidekiq_middleware/memory_killer.rb index 4831c46c4b..104280f520 100644 --- a/lib/gitlab/sidekiq_middleware/memory_killer.rb +++ b/lib/gitlab/sidekiq_middleware/memory_killer.rb @@ -29,11 +29,11 @@ module Gitlab "in #{GRACE_TIME} seconds" sleep(GRACE_TIME) - Sidekiq.logger.warn "sending SIGTERM to PID #{Process.pid}" + Sidekiq.logger.warn "sending SIGTERM to PID #{Process.pid} - Worker #{worker.class} - JID-#{job['jid']}" Process.kill('SIGTERM', Process.pid) Sidekiq.logger.warn "waiting #{SHUTDOWN_WAIT} seconds before sending "\ - "#{SHUTDOWN_SIGNAL} to PID #{Process.pid}" + "#{SHUTDOWN_SIGNAL} to PID #{Process.pid} - Worker #{worker.class} - JID-#{job['jid']}" sleep(SHUTDOWN_WAIT) Sidekiq.logger.warn "sending #{SHUTDOWN_SIGNAL} to PID #{Process.pid} - Worker #{worker.class} - JID-#{job['jid']}" From 09452715d341268898308d996e8a5f4ce20feb72 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Wed, 6 Jul 2016 11:09:07 +0200 Subject: [PATCH 3/3] fix typo --- lib/gitlab/import_export/command_line_util.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gitlab/import_export/command_line_util.rb b/lib/gitlab/import_export/command_line_util.rb index 3d0b23710c..62c736451b 100644 --- a/lib/gitlab/import_export/command_line_util.rb +++ b/lib/gitlab/import_export/command_line_util.rb @@ -29,7 +29,7 @@ module Gitlab def execute(cmd) output, status = Gitlab::Popen.popen(cmd) - @shared.error(output.to_s) unless status_zero? + @shared.error(output.to_s) unless status.zero? status.zero? end