Class: Gitlab::Database::Partitioning::WithPartitioningLockRetries

Inherits:
WithLockRetries
  • Object
show all
Defined in:
lib/gitlab/database/partitioning/with_partitioning_lock_retries.rb

Overview

Wrapper for Gitlab::Database::WithLockRetries.

It sets lock_timeout to a max of 1 second per transaction. It doesn’t holds the execution more than 27 seconds

Constant Summary collapse

LOCK_RETRIES_TIMING_CONFIGURATION =
[
  [0.1.seconds, 0.05.seconds],
  [0.1.seconds, 0.05.seconds],
  [0.2.seconds, 0.05.seconds],
  [0.3.seconds, 0.10.seconds],
  [0.4.seconds, 0.15.seconds],
  [0.5.seconds, 2.seconds],
  [0.5.seconds, 2.seconds],
  [0.5.seconds, 2.seconds],
  [0.5.seconds, 2.seconds],
  [1.second, 5.seconds]
].map(&:freeze).freeze

Constants inherited from WithLockRetries

WithLockRetries::AttemptsExhaustedError, WithLockRetries::DEFAULT_TIMING_CONFIGURATION, WithLockRetries::NULL_LOGGER

Instance Method Summary collapse

Methods inherited from WithLockRetries

#run

Constructor Details

#initialize(**args) ⇒ WithPartitioningLockRetries

Returns a new instance of WithPartitioningLockRetries.



23
24
25
26
27
# File 'lib/gitlab/database/partitioning/with_partitioning_lock_retries.rb', line 23

def initialize(**args)
  args[:timing_configuration] = LOCK_RETRIES_TIMING_CONFIGURATION * 2

  super
end