summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-07-06 13:09:02 +0000
committerRobert Speicher <rspeicher@gmail.com>2016-07-06 12:58:03 -0400
commit45a4e2484ea874fc1634227bf1fda9ea1c85af68 (patch)
tree89b689ca4da434f816c196abb8bf90436fe09ab2
parent0a98f267115d3f1b5b60dfd47ce66be17d435bdc (diff)
downloadgitlab-ce-45a4e2484ea874fc1634227bf1fda9ea1c85af68.tar.gz
Merge branch 'fix/project-export-error' into 'master'
Add more debug info to import/export and memory killer This should help debug https://gitlab.com/gitlab-org/gitlab-ce/issues/19124 further See merge request !5108 (cherry picked from commit b73da89591877e03ba9be7c415e30c3f07997373)
-rw-r--r--CHANGELOG1
-rw-r--r--app/services/projects/import_export/export_service.rb4
-rw-r--r--lib/gitlab/import_export/command_line_util.rb3
-rw-r--r--lib/gitlab/import_export/saver.rb1
-rw-r--r--lib/gitlab/sidekiq_middleware/memory_killer.rb4
5 files changed, 10 insertions, 3 deletions
diff --git a/CHANGELOG b/CHANGELOG
index b8e872f767a..e6b86390a0d 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
Please view this file on the master branch, on stable branches it's out of date.
v 8.9.5
+ - Add more debug info to import/export and memory killer. !5108
- Fixed avatar alignment in new MR view. !5095
- Fix diff comments not showing up in activity feed. !5069
- Add index on both Award Emoji user and name. !5061
diff --git a/app/services/projects/import_export/export_service.rb b/app/services/projects/import_export/export_service.rb
index 80c7193efcb..771fa8c2aa9 100644
--- a/app/services/projects/import_export/export_service.rb
+++ b/app/services/projects/import_export/export_service.rb
@@ -39,6 +39,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
@@ -46,6 +48,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
diff --git a/lib/gitlab/import_export/command_line_util.rb b/lib/gitlab/import_export/command_line_util.rb
index 78664f076eb..62c736451b7 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 f38229c6c59..dd4fdf37309 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 4831c46c4be..104280f520a 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']}"