Skip to content

Prevent StuckProjectImportJobsWorker from marking active migrations as stuck - GitHub Import

As mentioned in https://gitlab.com/gitlab-org/manage/import-and-integrate/discussions/-/issues/61#note_1650517323, StuckProjectImportJobsWorker can incorrectly mark imports as stuck if project.import_state.refresh_jid_expiration isn't called within 24 hours.

This problem can occur in two situations:

  1. The stage worker is executed for more than 24 hours
  2. AdvanceStageWorker takes more than 24 hours to move to the next stage

Proposed solution

Call the refresh_jid_expiration in two places:

  1. After reading each GitHub API page
  2. Using RefreshImportJidWorker when stage workers start
  3. Every time AdvanceWorkers executes and the number of pending jobs decreases.
Edited by Rodrigo Tomonari