Skip to content

Add additional logging to the phase 2 enqueuer

Proposal

Following up the observation made in &7528 (comment 877380989), we should add logging to the Enqueuer so that every job logs something useful about what happened during the job.

Looking at the #perform method:

      def perform
        return unless migration.enabled?
        return unless below_capacity?
        return unless waiting_time_passed?

        re_enqueue_if_capacity if handle_aborted_migration || handle_next_migration
      rescue StandardError => e
        ...
      end

Currently we log only on events in the last line of the method and in the rescue:

  • When handling an aborted migration
    • container_repository_id
    • import type: 'retry'
  • When handling the next migration
    • container_repository_id
    • import type: 'next'
  • When an error occurs
    • the container repository id (could be the aborted or next id depending on when the error occurred).

We should add logging for all of the return guards. These would only log if we reach these sections of code:

  • migration_enabled (true/false)
  • below_capacity (true/false)
  • current_capacity_setting (25, 10, 1, 0)
  • waiting_time_passed (true/false)
  • current_waiting_time_setting (0, 1 hour, 6 hours)
  • tag_count_too_high (true/false)
  • max_tag_count_setting