Module: RedisQueuedLocks::Acquirer::ReleaseLocksOf Private
- Extended by:
- Utilities
- Defined in:
- lib/redis_queued_locks/acquirer/release_locks_of.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Constant Summary
Constants included from Utilities
Utilities::RACTOR_LIVENESS_PATTERN, Utilities::RACTOR_STATUS_PATTERN, Utilities::RUBY_OVER_4
Class Method Summary collapse
-
.release_locks_of(refused_host_id, refused_acquirer_id, redis, lock_scan_size, queue_scan_size, logger, instrumenter, instrument, log_sampling_enabled, log_sampling_percent, log_sampler, log_sample_this, instr_sampling_enabled, instr_sampling_percent, instr_sampler, instr_sample_this) ⇒ Hash<Symbol,Any>
private
Release all queues and locks that belong to the given host and its associated acquirer.
Methods included from Utilities
clock_gettime, ractor_alive?, ractor_status, ruby_over_4?, run_non_critical, thread_state
Class Method Details
.release_locks_of(refused_host_id, refused_acquirer_id, redis, lock_scan_size, queue_scan_size, logger, instrumenter, instrument, log_sampling_enabled, log_sampling_percent, log_sampler, log_sample_this, instr_sampling_enabled, instr_sampling_percent, instr_sampler, instr_sample_this) ⇒ Hash<Symbol,Any>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Release all queues and locks that belong to the given host and its associated acquirer.
rubocop:disable Metrics/MethodLength
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/redis_queued_locks/acquirer/release_locks_of.rb', line 89 def release_locks_of( refused_host_id, refused_acquirer_id, redis, lock_scan_size, queue_scan_size, logger, instrumenter, instrument, log_sampling_enabled, log_sampling_percent, log_sampler, log_sample_this, instr_sampling_enabled, instr_sampling_percent, instr_sampler, instr_sample_this ) # TODO: move from SCAN to indexes :thinking: rel_start_time = clock_gettime # steep:ignore:start fully_release_locks_of( refused_host_id, refused_acquirer_id, redis, lock_scan_size, queue_scan_size ) => { ok:, result: } # steep:ignore:end # @type var ok: bool # @type var result: Hash[Symbol,Integer] time_at = Time.now.to_f rel_end_time = clock_gettime rel_time = ((rel_end_time - rel_start_time) / 1_000.0).ceil(2) instr_sampled = RedisQueuedLocks::Instrument.should_instrument?( instr_sampling_enabled, instr_sample_this, instr_sampling_percent, instr_sampler ) run_non_critical do instrumenter.notify('redis_queued_locks.release_locks_of', { at: time_at, hst_id: refused_host_id, acq_id: refused_acquirer_id, rel_time: rel_time, rel_key_cnt: result[:rel_key_cnt], tch_queue_cnt: result[:tch_queue_cnt] }) end if instr_sampled { ok: true, result: { rel_key_cnt: result[:rel_key_cnt], tch_queue_cnt: result[:tch_queue_cnt], rel_time: rel_time } } end |