ParallelProjectExportWorker should mark interrupted exports as failed
What does this MR do and why?
ParallelProjectExportWorker should mark interrupted exports as failed
Changelog: other
References
How to set up and validate locally
- Create a project.
- Apply this diff:
diff --git a/app/workers/projects/import_export/parallel_project_export_worker.rb b/app/workers/projects/import_export/parallel_project_export_worker.rb
index b88d0a66b350..ca44e51c982b 100644
--- a/app/workers/projects/import_export/parallel_project_export_worker.rb
+++ b/app/workers/projects/import_export/parallel_project_export_worker.rb
@@ -16,6 +16,7 @@ class ParallelProjectExportWorker
tags :import_shared_storage
loggable_arguments 1, 2
sidekiq_options retries: 3, dead: false, status_expiration: StuckExportJobsWorker::EXPORT_JOBS_EXPIRATION
+ sidekiq_options max_retries_after_interruption: 1
sidekiq_retries_exhausted do |job, exception|
perform_failure(
@@ -57,6 +58,7 @@ def self.perform_failure(job, message, exception)
end
def perform(project_export_job_id, user_id, after_export_strategy = {})
+ sleep 1000
export_job = ProjectExportJob.find(project_export_job_id)
return if export_job.finished?
- Trigger a project export:
curl --request POST \
--header "PRIVATE-TOKEN: $GITLAB_DEV_TOKEN" \
--url "http://gdk.test:3000/api/v4/projects/139/export"
- Monitor sidekiq in the dashboard. When
ParallelProjectExportWorkeris running, interrupt it withgdk restart rails-background-jobs. - Check
log/exporter.logfor the 'Export process reached the maximum number of interruptions' entry.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by James Nutt