Skip to content

Move FinishBatchedRelationExportWorker out of ensure block

What does this MR do and why?

This MR updates BulkImports::BatchedRelationExportService#execute and moves FinishBatchedRelationExportWorker outside of ensure block in order to avoid the following problematic scenario:

  1. Start new relation export (in batches) using BulkImports::BatchedRelationExportService
  2. A statement timeout error occurs during BulkImports::BatchedRelationExportService#enqueue_batch_exports which raises
  3. The ensure block of BulkImports::BatchedRelationExportService#execute still enqueues BulkImports::BatchedRelationExportService::FinishBatchedRelationExportWorker causing the export to be marked as finished with no batches exported
  4. As a result, the migration of said relation fails to complete

Mentions #431781 (closed)

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports