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
- Create a
BulkImports::RetriableNetworkError
; - Rescue network errors like 502, 429, etc on
BulkImports::Clients::Graphql#execute
andBulkImports::Gitlab::HTTP#request
and re-raise asBulkImports::RetriableNetworkError
; - Rescue
BulkImports::RetriableNetworkError
onBulkImports::PipelineWorker::#perform
and reschedule a job for the same worker; - The
BulkImports::PipelineWorker::#perform
should not retry more then 3 times.
Edited by Kassio Borges