Skip to content

Add retry logic for failures during import

Nikola Milojevic requested to merge 39100-retry-failures-during-import into master

As part of our short term effort to improve imports &1810 (closed) as explained in #39100 (closed)

We have some intermittent failures during import when accessing internal services, like Gitaly, DB.

This MR introduces retry mechanism for following exceptions:

  • ActiveRecord::StatementInvalid: Superclass for all database execution errors.
  • GRPC::DeadlineExceeded: Gitaly timeout

It will retry only on relation.save!, with intent of trying this at most 3 times.

Total number of retries, final retry status and exception details are stored in ImportFailure.

If retry succeed, retried status is set to success, otherwise we set status to failed

Conformity

Availability and Testing

This change should have very little impact on performance of the application, but it should make import more reliable.

Relates #39100 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading