Skip to content

Handle Gitlab Migration network/rate limit errors

Problem to solve

Currently, any network errors within the Gitlab Migration (BulkImports) fail the import or the pipeline that raised the error, but some errors should trigger a retry instead of failing the import/pipeline.

Related to: !43155 (comment 421147461)

Proposed Solution

  1. Create a BulkImports::RetriableNetworkError;
  2. Rescue network errors like 502, 429, etc on BulkImports::Clients::Graphql#execute and BulkImports::Gitlab::HTTP#request and re-raise as BulkImports::RetriableNetworkError;
  3. Rescue BulkImports::RetriableNetworkError on BulkImports::PipelineWorker::#perform and reschedule a job for the same worker;
  4. The BulkImports::PipelineWorker::#perform should not retry more then 3 times.
Edited by Kassio Borges