redis_queued_locks 1.12.1 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/.rubocop.yml +3 -1
 - data/.ruby-version +1 -1
 - data/CHANGELOG.md +45 -5
 - data/LICENSE.txt +1 -1
 - data/README.md +574 -296
 - data/Rakefile +12 -4
 - data/Steepfile +15 -0
 - data/github_ci/ruby3.3.gemfile +17 -0
 - data/github_ci/ruby3.3.gemfile.lock +217 -0
 - data/lib/redis_queued_locks/{acquier → acquirer}/acquire_lock/delay_execution.rb +4 -4
 - data/lib/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue/log_visitor.rb +40 -0
 - data/lib/redis_queued_locks/{acquier → acquirer}/acquire_lock/dequeue_from_lock_queue.rb +17 -8
 - data/lib/redis_queued_locks/acquirer/acquire_lock/instr_visitor.rb +166 -0
 - data/lib/redis_queued_locks/acquirer/acquire_lock/log_visitor.rb +218 -0
 - data/lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rb +543 -0
 - data/lib/redis_queued_locks/{acquier → acquirer}/acquire_lock/try_to_lock.rb +126 -92
 - data/lib/redis_queued_locks/{acquier → acquirer}/acquire_lock/with_acq_timeout.rb +14 -9
 - data/lib/redis_queued_locks/acquirer/acquire_lock/yield_expire/log_visitor.rb +76 -0
 - data/lib/redis_queued_locks/{acquier → acquirer}/acquire_lock/yield_expire.rb +42 -19
 - data/lib/redis_queued_locks/{acquier → acquirer}/acquire_lock.rb +74 -47
 - data/lib/redis_queued_locks/{acquier → acquirer}/clear_dead_requests.rb +5 -3
 - data/lib/redis_queued_locks/{acquier → acquirer}/extend_lock_ttl.rb +4 -3
 - data/lib/redis_queued_locks/{acquier → acquirer}/is_locked.rb +1 -1
 - data/lib/redis_queued_locks/{acquier → acquirer}/is_queued.rb +1 -1
 - data/lib/redis_queued_locks/{acquier → acquirer}/keys.rb +5 -5
 - data/lib/redis_queued_locks/{acquier → acquirer}/lock_info.rb +9 -5
 - data/lib/redis_queued_locks/{acquier → acquirer}/locks.rb +16 -3
 - data/lib/redis_queued_locks/{acquier → acquirer}/queue_info.rb +8 -6
 - data/lib/redis_queued_locks/{acquier → acquirer}/queues.rb +9 -2
 - data/lib/redis_queued_locks/{acquier → acquirer}/release_all_locks.rb +26 -21
 - data/lib/redis_queued_locks/{acquier → acquirer}/release_lock.rb +28 -22
 - data/lib/redis_queued_locks/acquirer/release_locks_of.rb +211 -0
 - data/lib/redis_queued_locks/acquirer.rb +19 -0
 - data/lib/redis_queued_locks/client.rb +317 -254
 - data/lib/redis_queued_locks/config/dsl.rb +94 -0
 - data/lib/redis_queued_locks/config.rb +236 -0
 - data/lib/redis_queued_locks/data.rb +2 -0
 - data/lib/redis_queued_locks/errors.rb +27 -11
 - data/lib/redis_queued_locks/instrument.rb +11 -4
 - data/lib/redis_queued_locks/logging/void_logger.rb +38 -1
 - data/lib/redis_queued_locks/logging.rb +20 -5
 - data/lib/redis_queued_locks/resource.rb +49 -11
 - data/lib/redis_queued_locks/swarm/acquirers.rb +17 -16
 - data/lib/redis_queued_locks/swarm/flush_zombies.rb +26 -25
 - data/lib/redis_queued_locks/swarm/probe_hosts.rb +20 -19
 - data/lib/redis_queued_locks/swarm/redis_client_builder.rb +3 -3
 - data/lib/redis_queued_locks/swarm/supervisor.rb +19 -6
 - data/lib/redis_queued_locks/swarm/swarm_element/isolated.rb +20 -18
 - data/lib/redis_queued_locks/swarm/swarm_element/threaded.rb +35 -27
 - data/lib/redis_queued_locks/swarm/zombie_info.rb +9 -9
 - data/lib/redis_queued_locks/swarm.rb +20 -41
 - data/lib/redis_queued_locks/utilities.rb +11 -2
 - data/lib/redis_queued_locks/version.rb +2 -2
 - data/lib/redis_queued_locks.rb +2 -3
 - data/rbs_collection.lock.yaml +28 -0
 - data/rbs_collection.yaml +17 -0
 - data/redis_queued_locks.gemspec +22 -23
 - data/sig/manifest.yml +6 -0
 - data/sig/redis_queued_locks/acquier.rbs +4 -0
 - data/sig/redis_queued_locks/acquirer/acquire_lock/delay_execution.rbs +9 -0
 - data/sig/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue/log_visitor.rbs +21 -0
 - data/sig/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue.rbs +26 -0
 - data/sig/redis_queued_locks/acquirer/acquire_lock/instr_visitor.rbs +71 -0
 - data/sig/redis_queued_locks/acquirer/acquire_lock/log_visitor.rbs +72 -0
 - data/sig/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rbs +179 -0
 - data/sig/redis_queued_locks/acquirer/acquire_lock/try_to_lock.rbs +48 -0
 - data/sig/redis_queued_locks/acquirer/acquire_lock/with_acq_timeout.rbs +19 -0
 - data/sig/redis_queued_locks/acquirer/acquire_lock/yield_expire.rbs +41 -0
 - data/sig/redis_queued_locks/acquirer/acquire_lock/yield_with_expire/log_visitor.rbs +32 -0
 - data/sig/redis_queued_locks/acquirer/acquire_lock.rbs +52 -0
 - data/sig/redis_queued_locks/acquirer/clear_dead_requests.rbs +28 -0
 - data/sig/redis_queued_locks/acquirer/extend_lock_ttl.rbs +28 -0
 - data/sig/redis_queued_locks/acquirer/is_locked.rbs +9 -0
 - data/sig/redis_queued_locks/acquirer/is_queued.rbs +9 -0
 - data/sig/redis_queued_locks/acquirer/keys.rbs +10 -0
 - data/sig/redis_queued_locks/acquirer/lock_info.rbs +10 -0
 - data/sig/redis_queued_locks/acquirer/locks.rbs +16 -0
 - data/sig/redis_queued_locks/acquirer/queue_info.rbs +13 -0
 - data/sig/redis_queued_locks/acquirer/queues.rbs +16 -0
 - data/sig/redis_queued_locks/acquirer/release_all_locks.rbs +30 -0
 - data/sig/redis_queued_locks/acquirer/release_lock.rbs +38 -0
 - data/sig/redis_queued_locks/acquirer/release_locks_of.rbs +46 -0
 - data/sig/redis_queued_locks/client.rbs +235 -0
 - data/sig/redis_queued_locks/config/dsl.rbs +26 -0
 - data/sig/redis_queued_locks/config.rbs +23 -0
 - data/sig/redis_queued_locks/data.rbs +4 -0
 - data/sig/redis_queued_locks/debugger/interface.rbs +9 -0
 - data/sig/redis_queued_locks/debugger.rbs +13 -0
 - data/sig/redis_queued_locks/errors.rbs +43 -0
 - data/sig/redis_queued_locks/instrument/active_support.rbs +7 -0
 - data/sig/redis_queued_locks/instrument/sampler.rbs +9 -0
 - data/sig/redis_queued_locks/instrument/void_notifier.rbs +7 -0
 - data/sig/redis_queued_locks/instrument.rbs +15 -0
 - data/sig/redis_queued_locks/logging/sampler.rbs +9 -0
 - data/sig/redis_queued_locks/logging/void_logger.rbs +15 -0
 - data/sig/redis_queued_locks/logging.rbs +15 -0
 - data/sig/redis_queued_locks/resource.rbs +42 -0
 - data/sig/redis_queued_locks/swarm/acquirers.rbs +10 -0
 - data/sig/redis_queued_locks/swarm/flush_zombies.rbs +13 -0
 - data/sig/redis_queued_locks/swarm/probe_hosts.rbs +13 -0
 - data/sig/redis_queued_locks/swarm/redis_client_builder.rbs +19 -0
 - data/sig/redis_queued_locks/swarm/supervisor.rbs +26 -0
 - data/sig/redis_queued_locks/swarm/swarm_element/isolated.rbs +52 -0
 - data/sig/redis_queued_locks/swarm/swarm_element/threaded.rbs +61 -0
 - data/sig/redis_queued_locks/swarm/swarm_element.rbs +8 -0
 - data/sig/redis_queued_locks/swarm/zombie_info.rbs +24 -0
 - data/sig/redis_queued_locks/swarm.rbs +41 -0
 - data/sig/redis_queued_locks/utilities/lock.rbs +10 -0
 - data/sig/redis_queued_locks/utilities.rbs +12 -0
 - data/sig/redis_queued_locks/version.rbs +3 -0
 - data/sig/redis_queued_locks.rbs +14 -0
 - data/sig/vendor/active_support.rbs +9 -0
 - data/sig/vendor/redis_client.rbs +39 -0
 - data/sig/vendor/semantic_logger.rbs +4 -0
 - metadata +98 -54
 - data/lib/redis_queued_locks/acquier/acquire_lock/dequeue_from_lock_queue/log_visitor.rb +0 -40
 - data/lib/redis_queued_locks/acquier/acquire_lock/instr_visitor.rb +0 -166
 - data/lib/redis_queued_locks/acquier/acquire_lock/log_visitor.rb +0 -216
 - data/lib/redis_queued_locks/acquier/acquire_lock/try_to_lock/log_visitor.rb +0 -541
 - data/lib/redis_queued_locks/acquier/acquire_lock/yield_expire/log_visitor.rb +0 -76
 - data/lib/redis_queued_locks/acquier.rb +0 -18
 
| 
         @@ -0,0 +1,218 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            # @api private
         
     | 
| 
      
 4 
     | 
    
         
            +
            # @since 1.7.0
         
     | 
| 
      
 5 
     | 
    
         
            +
            # rubocop:disable Metrics/ModuleLength
         
     | 
| 
      
 6 
     | 
    
         
            +
            module RedisQueuedLocks::Acquirer::AcquireLock::LogVisitor
         
     | 
| 
      
 7 
     | 
    
         
            +
              # rubocop:disable Metrics/ClassLength
         
     | 
| 
      
 8 
     | 
    
         
            +
              class << self
         
     | 
| 
      
 9 
     | 
    
         
            +
                # @param logger [::Logger,#debug]
         
     | 
| 
      
 10 
     | 
    
         
            +
                # @param log_sampled [Boolean]
         
     | 
| 
      
 11 
     | 
    
         
            +
                # @param lock_key [String]
         
     | 
| 
      
 12 
     | 
    
         
            +
                # @param queue_ttl [Integer]
         
     | 
| 
      
 13 
     | 
    
         
            +
                # @param acquirer_id [String]
         
     | 
| 
      
 14 
     | 
    
         
            +
                # @param host_id [String]
         
     | 
| 
      
 15 
     | 
    
         
            +
                # @param access_strategy [Symbol]
         
     | 
| 
      
 16 
     | 
    
         
            +
                # @return [void]
         
     | 
| 
      
 17 
     | 
    
         
            +
                #
         
     | 
| 
      
 18 
     | 
    
         
            +
                # @api private
         
     | 
| 
      
 19 
     | 
    
         
            +
                # @since 1.7.0
         
     | 
| 
      
 20 
     | 
    
         
            +
                # @version 1.9.0
         
     | 
| 
      
 21 
     | 
    
         
            +
                def start_lock_obtaining(
         
     | 
| 
      
 22 
     | 
    
         
            +
                  logger,
         
     | 
| 
      
 23 
     | 
    
         
            +
                  log_sampled,
         
     | 
| 
      
 24 
     | 
    
         
            +
                  lock_key,
         
     | 
| 
      
 25 
     | 
    
         
            +
                  queue_ttl,
         
     | 
| 
      
 26 
     | 
    
         
            +
                  acquirer_id,
         
     | 
| 
      
 27 
     | 
    
         
            +
                  host_id,
         
     | 
| 
      
 28 
     | 
    
         
            +
                  access_strategy
         
     | 
| 
      
 29 
     | 
    
         
            +
                )
         
     | 
| 
      
 30 
     | 
    
         
            +
                  return unless log_sampled
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
                  logger.debug do
         
     | 
| 
      
 33 
     | 
    
         
            +
                    "[redis_queued_locks.start_lock_obtaining] " \
         
     | 
| 
      
 34 
     | 
    
         
            +
                    "lock_key => '#{lock_key}' " \
         
     | 
| 
      
 35 
     | 
    
         
            +
                    "queue_ttl => #{queue_ttl} " \
         
     | 
| 
      
 36 
     | 
    
         
            +
                    "acq_id => '#{acquirer_id}' " \
         
     | 
| 
      
 37 
     | 
    
         
            +
                    "hst_id => '#{host_id}' " \
         
     | 
| 
      
 38 
     | 
    
         
            +
                    "acs_strat => '#{access_strategy}'"
         
     | 
| 
      
 39 
     | 
    
         
            +
                  end rescue nil
         
     | 
| 
      
 40 
     | 
    
         
            +
                end
         
     | 
| 
      
 41 
     | 
    
         
            +
             
     | 
| 
      
 42 
     | 
    
         
            +
                # @param logger [::Logger,#debug]
         
     | 
| 
      
 43 
     | 
    
         
            +
                # @param log_sampled [Boolean]
         
     | 
| 
      
 44 
     | 
    
         
            +
                # @param lock_key [String]
         
     | 
| 
      
 45 
     | 
    
         
            +
                # @param queue_ttl [Integer]
         
     | 
| 
      
 46 
     | 
    
         
            +
                # @param acquirer_id [String]
         
     | 
| 
      
 47 
     | 
    
         
            +
                # @param host_id [String]
         
     | 
| 
      
 48 
     | 
    
         
            +
                # @param access_strategy [Symbol]
         
     | 
| 
      
 49 
     | 
    
         
            +
                # @return [void]
         
     | 
| 
      
 50 
     | 
    
         
            +
                #
         
     | 
| 
      
 51 
     | 
    
         
            +
                # @api private
         
     | 
| 
      
 52 
     | 
    
         
            +
                # @since 1.7.0
         
     | 
| 
      
 53 
     | 
    
         
            +
                # @version 1.9.0
         
     | 
| 
      
 54 
     | 
    
         
            +
                def start_try_to_lock_cycle(
         
     | 
| 
      
 55 
     | 
    
         
            +
                  logger,
         
     | 
| 
      
 56 
     | 
    
         
            +
                  log_sampled,
         
     | 
| 
      
 57 
     | 
    
         
            +
                  lock_key,
         
     | 
| 
      
 58 
     | 
    
         
            +
                  queue_ttl,
         
     | 
| 
      
 59 
     | 
    
         
            +
                  acquirer_id,
         
     | 
| 
      
 60 
     | 
    
         
            +
                  host_id,
         
     | 
| 
      
 61 
     | 
    
         
            +
                  access_strategy
         
     | 
| 
      
 62 
     | 
    
         
            +
                )
         
     | 
| 
      
 63 
     | 
    
         
            +
                  return unless log_sampled
         
     | 
| 
      
 64 
     | 
    
         
            +
             
     | 
| 
      
 65 
     | 
    
         
            +
                  logger.debug do
         
     | 
| 
      
 66 
     | 
    
         
            +
                    "[redis_queued_locks.start_try_to_lock_cycle] " \
         
     | 
| 
      
 67 
     | 
    
         
            +
                    "lock_key => '#{lock_key}' " \
         
     | 
| 
      
 68 
     | 
    
         
            +
                    "queue_ttl => #{queue_ttl} " \
         
     | 
| 
      
 69 
     | 
    
         
            +
                    "acq_id => '#{acquirer_id}' " \
         
     | 
| 
      
 70 
     | 
    
         
            +
                    "hst_id => '#{host_id}' " \
         
     | 
| 
      
 71 
     | 
    
         
            +
                    "acs_strat => '#{access_strategy}'"
         
     | 
| 
      
 72 
     | 
    
         
            +
                  end rescue nil
         
     | 
| 
      
 73 
     | 
    
         
            +
                end
         
     | 
| 
      
 74 
     | 
    
         
            +
             
     | 
| 
      
 75 
     | 
    
         
            +
                # @param logger [::Logger,#debug]
         
     | 
| 
      
 76 
     | 
    
         
            +
                # @param log_sampled [Boolean]
         
     | 
| 
      
 77 
     | 
    
         
            +
                # @param lock_key [String]
         
     | 
| 
      
 78 
     | 
    
         
            +
                # @param queue_ttl [Integer]
         
     | 
| 
      
 79 
     | 
    
         
            +
                # @param acquirer_id [String]
         
     | 
| 
      
 80 
     | 
    
         
            +
                # @param host_id [String]
         
     | 
| 
      
 81 
     | 
    
         
            +
                # @param access_strategy [Symbol]
         
     | 
| 
      
 82 
     | 
    
         
            +
                # @return [void]
         
     | 
| 
      
 83 
     | 
    
         
            +
                #
         
     | 
| 
      
 84 
     | 
    
         
            +
                # @api private
         
     | 
| 
      
 85 
     | 
    
         
            +
                # @since 1.7.0
         
     | 
| 
      
 86 
     | 
    
         
            +
                # @version 1.9.0
         
     | 
| 
      
 87 
     | 
    
         
            +
                def dead_score_reached__reset_acquirer_position(
         
     | 
| 
      
 88 
     | 
    
         
            +
                  logger,
         
     | 
| 
      
 89 
     | 
    
         
            +
                  log_sampled,
         
     | 
| 
      
 90 
     | 
    
         
            +
                  lock_key,
         
     | 
| 
      
 91 
     | 
    
         
            +
                  queue_ttl,
         
     | 
| 
      
 92 
     | 
    
         
            +
                  acquirer_id,
         
     | 
| 
      
 93 
     | 
    
         
            +
                  host_id,
         
     | 
| 
      
 94 
     | 
    
         
            +
                  access_strategy
         
     | 
| 
      
 95 
     | 
    
         
            +
                )
         
     | 
| 
      
 96 
     | 
    
         
            +
                  return unless log_sampled
         
     | 
| 
      
 97 
     | 
    
         
            +
             
     | 
| 
      
 98 
     | 
    
         
            +
                  logger.debug do
         
     | 
| 
      
 99 
     | 
    
         
            +
                    "[redis_queued_locks.dead_score_reached__reset_acquirer_position] " \
         
     | 
| 
      
 100 
     | 
    
         
            +
                    "lock_key => '#{lock_key}' " \
         
     | 
| 
      
 101 
     | 
    
         
            +
                    "queue_ttl => #{queue_ttl} " \
         
     | 
| 
      
 102 
     | 
    
         
            +
                    "acq_id => '#{acquirer_id}' " \
         
     | 
| 
      
 103 
     | 
    
         
            +
                    "hst_id => '#{host_id}' " \
         
     | 
| 
      
 104 
     | 
    
         
            +
                    "acs_strat => '#{access_strategy}'"
         
     | 
| 
      
 105 
     | 
    
         
            +
                  end rescue nil
         
     | 
| 
      
 106 
     | 
    
         
            +
                end
         
     | 
| 
      
 107 
     | 
    
         
            +
             
     | 
| 
      
 108 
     | 
    
         
            +
                # @param logger [::Logger,#debug]
         
     | 
| 
      
 109 
     | 
    
         
            +
                # @param log_sampled [Boolean]
         
     | 
| 
      
 110 
     | 
    
         
            +
                # @param lock_key [String]
         
     | 
| 
      
 111 
     | 
    
         
            +
                # @param queue_ttl [Integer]
         
     | 
| 
      
 112 
     | 
    
         
            +
                # @param acquirer_id [String]
         
     | 
| 
      
 113 
     | 
    
         
            +
                # @param host_id [String]
         
     | 
| 
      
 114 
     | 
    
         
            +
                # @param acq_time [Numeric]
         
     | 
| 
      
 115 
     | 
    
         
            +
                # @param access_strategy [Symbol]
         
     | 
| 
      
 116 
     | 
    
         
            +
                # @return [void]
         
     | 
| 
      
 117 
     | 
    
         
            +
                #
         
     | 
| 
      
 118 
     | 
    
         
            +
                # @api private
         
     | 
| 
      
 119 
     | 
    
         
            +
                # @since 1.7.0
         
     | 
| 
      
 120 
     | 
    
         
            +
                # @version 1.9.0
         
     | 
| 
      
 121 
     | 
    
         
            +
                def extendable_reentrant_lock_obtained(
         
     | 
| 
      
 122 
     | 
    
         
            +
                  logger,
         
     | 
| 
      
 123 
     | 
    
         
            +
                  log_sampled,
         
     | 
| 
      
 124 
     | 
    
         
            +
                  lock_key,
         
     | 
| 
      
 125 
     | 
    
         
            +
                  queue_ttl,
         
     | 
| 
      
 126 
     | 
    
         
            +
                  acquirer_id,
         
     | 
| 
      
 127 
     | 
    
         
            +
                  host_id,
         
     | 
| 
      
 128 
     | 
    
         
            +
                  acq_time,
         
     | 
| 
      
 129 
     | 
    
         
            +
                  access_strategy
         
     | 
| 
      
 130 
     | 
    
         
            +
                )
         
     | 
| 
      
 131 
     | 
    
         
            +
                  return unless log_sampled
         
     | 
| 
      
 132 
     | 
    
         
            +
             
     | 
| 
      
 133 
     | 
    
         
            +
                  logger.debug do
         
     | 
| 
      
 134 
     | 
    
         
            +
                    "[redis_queued_locks.extendable_reentrant_lock_obtained] " \
         
     | 
| 
      
 135 
     | 
    
         
            +
                    "lock_key => '#{lock_key}' " \
         
     | 
| 
      
 136 
     | 
    
         
            +
                    "queue_ttl => #{queue_ttl} " \
         
     | 
| 
      
 137 
     | 
    
         
            +
                    "acq_id => '#{acquirer_id}' " \
         
     | 
| 
      
 138 
     | 
    
         
            +
                    "host_id => '#{host_id}' " \
         
     | 
| 
      
 139 
     | 
    
         
            +
                    "acs_strat => '#{access_strategy}' " \
         
     | 
| 
      
 140 
     | 
    
         
            +
                    "acq_time => #{acq_time} (ms)"
         
     | 
| 
      
 141 
     | 
    
         
            +
                  end rescue nil
         
     | 
| 
      
 142 
     | 
    
         
            +
                end
         
     | 
| 
      
 143 
     | 
    
         
            +
             
     | 
| 
      
 144 
     | 
    
         
            +
                # @param logger [::Logger,#debug]
         
     | 
| 
      
 145 
     | 
    
         
            +
                # @param log_sampled [Boolean]
         
     | 
| 
      
 146 
     | 
    
         
            +
                # @param lock_key [String]
         
     | 
| 
      
 147 
     | 
    
         
            +
                # @param queue_ttl [Integer]
         
     | 
| 
      
 148 
     | 
    
         
            +
                # @param acquirer_id [String]
         
     | 
| 
      
 149 
     | 
    
         
            +
                # @param host_id [String]
         
     | 
| 
      
 150 
     | 
    
         
            +
                # @param acq_time [Numeric]
         
     | 
| 
      
 151 
     | 
    
         
            +
                # @param access_strategy [Symbol]
         
     | 
| 
      
 152 
     | 
    
         
            +
                # @return [void]
         
     | 
| 
      
 153 
     | 
    
         
            +
                #
         
     | 
| 
      
 154 
     | 
    
         
            +
                # @api private
         
     | 
| 
      
 155 
     | 
    
         
            +
                # @since 1.7.0
         
     | 
| 
      
 156 
     | 
    
         
            +
                # @version 1.9.0
         
     | 
| 
      
 157 
     | 
    
         
            +
                def reentrant_lock_obtained(
         
     | 
| 
      
 158 
     | 
    
         
            +
                  logger,
         
     | 
| 
      
 159 
     | 
    
         
            +
                  log_sampled,
         
     | 
| 
      
 160 
     | 
    
         
            +
                  lock_key,
         
     | 
| 
      
 161 
     | 
    
         
            +
                  queue_ttl,
         
     | 
| 
      
 162 
     | 
    
         
            +
                  acquirer_id,
         
     | 
| 
      
 163 
     | 
    
         
            +
                  host_id,
         
     | 
| 
      
 164 
     | 
    
         
            +
                  acq_time,
         
     | 
| 
      
 165 
     | 
    
         
            +
                  access_strategy
         
     | 
| 
      
 166 
     | 
    
         
            +
                )
         
     | 
| 
      
 167 
     | 
    
         
            +
                  return unless log_sampled
         
     | 
| 
      
 168 
     | 
    
         
            +
             
     | 
| 
      
 169 
     | 
    
         
            +
                  logger.debug do
         
     | 
| 
      
 170 
     | 
    
         
            +
                    "[redis_queued_locks.reentrant_lock_obtained] " \
         
     | 
| 
      
 171 
     | 
    
         
            +
                    "lock_key => '#{lock_key}' " \
         
     | 
| 
      
 172 
     | 
    
         
            +
                    "queue_ttl => #{queue_ttl} " \
         
     | 
| 
      
 173 
     | 
    
         
            +
                    "acq_id => '#{acquirer_id}' " \
         
     | 
| 
      
 174 
     | 
    
         
            +
                    "hst_id => '#{host_id}' " \
         
     | 
| 
      
 175 
     | 
    
         
            +
                    "acs_strat => '#{access_strategy}' " \
         
     | 
| 
      
 176 
     | 
    
         
            +
                    "acq_time => #{acq_time} (ms)"
         
     | 
| 
      
 177 
     | 
    
         
            +
                  end rescue nil
         
     | 
| 
      
 178 
     | 
    
         
            +
                end
         
     | 
| 
      
 179 
     | 
    
         
            +
             
     | 
| 
      
 180 
     | 
    
         
            +
                # @param logger [::Logger,#debug]
         
     | 
| 
      
 181 
     | 
    
         
            +
                # @param log_sampled [Boolean]
         
     | 
| 
      
 182 
     | 
    
         
            +
                # @param lock_key [String]
         
     | 
| 
      
 183 
     | 
    
         
            +
                # @param queue_ttl [Integer]
         
     | 
| 
      
 184 
     | 
    
         
            +
                # @param acquirer_id [String]
         
     | 
| 
      
 185 
     | 
    
         
            +
                # @param host_id [String]
         
     | 
| 
      
 186 
     | 
    
         
            +
                # @param acq_time [Numeric]
         
     | 
| 
      
 187 
     | 
    
         
            +
                # @param access_strategy [Symbol]
         
     | 
| 
      
 188 
     | 
    
         
            +
                # @return [void]
         
     | 
| 
      
 189 
     | 
    
         
            +
                #
         
     | 
| 
      
 190 
     | 
    
         
            +
                # @api private
         
     | 
| 
      
 191 
     | 
    
         
            +
                # @since 1.7.0
         
     | 
| 
      
 192 
     | 
    
         
            +
                # @version 1.9.0
         
     | 
| 
      
 193 
     | 
    
         
            +
                def lock_obtained(
         
     | 
| 
      
 194 
     | 
    
         
            +
                  logger,
         
     | 
| 
      
 195 
     | 
    
         
            +
                  log_sampled,
         
     | 
| 
      
 196 
     | 
    
         
            +
                  lock_key,
         
     | 
| 
      
 197 
     | 
    
         
            +
                  queue_ttl,
         
     | 
| 
      
 198 
     | 
    
         
            +
                  acquirer_id,
         
     | 
| 
      
 199 
     | 
    
         
            +
                  host_id,
         
     | 
| 
      
 200 
     | 
    
         
            +
                  acq_time,
         
     | 
| 
      
 201 
     | 
    
         
            +
                  access_strategy
         
     | 
| 
      
 202 
     | 
    
         
            +
                )
         
     | 
| 
      
 203 
     | 
    
         
            +
                  return unless log_sampled
         
     | 
| 
      
 204 
     | 
    
         
            +
             
     | 
| 
      
 205 
     | 
    
         
            +
                  logger.debug do
         
     | 
| 
      
 206 
     | 
    
         
            +
                    "[redis_queued_locks.lock_obtained] " \
         
     | 
| 
      
 207 
     | 
    
         
            +
                    "lock_key => '#{lock_key}' " \
         
     | 
| 
      
 208 
     | 
    
         
            +
                    "queue_ttl => #{queue_ttl} " \
         
     | 
| 
      
 209 
     | 
    
         
            +
                    "acq_id => '#{acquirer_id}' " \
         
     | 
| 
      
 210 
     | 
    
         
            +
                    "hst_id => '#{host_id}' " \
         
     | 
| 
      
 211 
     | 
    
         
            +
                    "acs_strat => '#{access_strategy}' " \
         
     | 
| 
      
 212 
     | 
    
         
            +
                    "acq_time => #{acq_time} (ms)"
         
     | 
| 
      
 213 
     | 
    
         
            +
                  end rescue nil
         
     | 
| 
      
 214 
     | 
    
         
            +
                end
         
     | 
| 
      
 215 
     | 
    
         
            +
              end
         
     | 
| 
      
 216 
     | 
    
         
            +
              # rubocop:enable Metrics/ClassLength
         
     | 
| 
      
 217 
     | 
    
         
            +
            end
         
     | 
| 
      
 218 
     | 
    
         
            +
            # rubocop:enable Metrics/ModuleLength
         
     |