redis_queued_locks 1.20.0 → 1.21.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/.claude/project-overview.md +35 -13
- data/.claude/rules/acquirer.md +10 -9
- data/.claude/rules/logic.md +28 -5
- data/.claude/rules/swarm.md +2 -2
- data/.claude/rules/tests.md +6 -3
- data/.claude/rules/visitors.md +9 -10
- data/.claude/skills/rql-code-review/SKILL.md +24 -10
- data/CHANGELOG.md +126 -0
- data/CLAUDE.md +2 -1
- data/README.md +245 -70
- data/lib/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue/log_visitor.rb +1 -0
- data/lib/redis_queued_locks/acquirer/acquire_lock/instr_visitor.rb +42 -0
- data/lib/redis_queued_locks/acquirer/acquire_lock/log_visitor.rb +45 -0
- data/lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rb +1 -0
- data/lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock.rb +12 -1
- data/lib/redis_queued_locks/acquirer/acquire_lock/with_acq_timeout.rb +2 -2
- data/lib/redis_queued_locks/acquirer/acquire_lock/yield_expire/log_visitor.rb +1 -0
- data/lib/redis_queued_locks/acquirer/acquire_lock/yield_expire.rb +5 -5
- data/lib/redis_queued_locks/acquirer/acquire_lock.rb +111 -24
- data/lib/redis_queued_locks/acquirer/clear_dead_requests.rb +86 -8
- data/lib/redis_queued_locks/acquirer/extend_lock_ttl.rb +122 -12
- data/lib/redis_queued_locks/acquirer/is_locked.rb +0 -1
- data/lib/redis_queued_locks/acquirer/is_queued.rb +0 -1
- data/lib/redis_queued_locks/acquirer/keys.rb +10 -1
- data/lib/redis_queued_locks/acquirer/lock_info.rb +31 -39
- data/lib/redis_queued_locks/acquirer/lock_series_poc/instr_visitor.rb +3 -2
- data/lib/redis_queued_locks/acquirer/lock_series_poc/log_visitor.rb +5 -4
- data/lib/redis_queued_locks/acquirer/lock_series_poc.rb +55 -15
- data/lib/redis_queued_locks/acquirer/locks.rb +26 -9
- data/lib/redis_queued_locks/acquirer/queue_info.rb +0 -1
- data/lib/redis_queued_locks/acquirer/queues.rb +10 -1
- data/lib/redis_queued_locks/acquirer/reindex_locks.rb +117 -4
- data/lib/redis_queued_locks/acquirer/release_all_locks.rb +31 -4
- data/lib/redis_queued_locks/acquirer/release_lock.rb +33 -7
- data/lib/redis_queued_locks/acquirer/release_locks_of.rb +39 -4
- data/lib/redis_queued_locks/acquirer/release_read_lock.rb +22 -3
- data/lib/redis_queued_locks/client.rb +82 -40
- data/lib/redis_queued_locks/config.rb +12 -13
- data/lib/redis_queued_locks/errors.rb +34 -4
- data/lib/redis_queued_locks/instrument/sampler.rb +4 -7
- data/lib/redis_queued_locks/logging/sampler.rb +4 -8
- data/lib/redis_queued_locks/resource.rb +14 -4
- data/lib/redis_queued_locks/swarm/flush_zombies.rb +1 -0
- data/lib/redis_queued_locks/swarm/redis_client_builder.rb +8 -4
- data/lib/redis_queued_locks/swarm/swarm_element/threaded.rb +3 -2
- data/lib/redis_queued_locks/swarm.rb +86 -5
- data/lib/redis_queued_locks/utilities.rb +1 -1
- data/lib/redis_queued_locks/version.rb +2 -2
- data/sig/redis_queued_locks/acquirer/acquire_lock/instr_visitor.rbs +14 -0
- data/sig/redis_queued_locks/acquirer/acquire_lock/log_visitor.rbs +13 -0
- data/sig/redis_queued_locks/acquirer/acquire_lock/yield_expire.rbs +2 -2
- data/sig/redis_queued_locks/acquirer/acquire_lock.rbs +1 -1
- data/sig/redis_queued_locks/acquirer/clear_dead_requests.rbs +9 -0
- data/sig/redis_queued_locks/acquirer/extend_lock_ttl.rbs +15 -2
- data/sig/redis_queued_locks/acquirer/reindex_locks.rbs +22 -1
- data/sig/redis_queued_locks/acquirer/release_lock.rbs +3 -2
- data/sig/redis_queued_locks/acquirer/release_read_lock.rbs +1 -1
- data/sig/redis_queued_locks/client.rbs +14 -3
- data/sig/redis_queued_locks/errors.rbs +5 -2
- data/sig/redis_queued_locks/instrument/sampler.rbs +0 -2
- data/sig/redis_queued_locks/logging/sampler.rbs +0 -2
- data/sig/redis_queued_locks/resource.rbs +1 -1
- data/sig/vendor/redis_client.rbs +1 -0
- metadata +1 -1
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# @api public
|
|
4
4
|
# @since 1.9.0
|
|
5
|
+
# @version 1.13.0
|
|
5
6
|
# rubocop:disable Metrics/ClassLength
|
|
6
7
|
class RedisQueuedLocks::Swarm
|
|
7
8
|
require_relative 'swarm/redis_client_builder'
|
|
@@ -76,7 +77,16 @@ class RedisQueuedLocks::Swarm
|
|
|
76
77
|
#
|
|
77
78
|
# @api public
|
|
78
79
|
# @since 1.9.0
|
|
80
|
+
# @version 1.21.0
|
|
79
81
|
def swarm_info(zombie_ttl: rql_client.config['swarm.flush_zombies.zombie_ttl'])
|
|
82
|
+
# NOTE: (arguments) the same ranges as the config keys;
|
|
83
|
+
if !zombie_ttl.is_a?(::Integer) || zombie_ttl <= 0
|
|
84
|
+
raise(
|
|
85
|
+
RedisQueuedLocks::SwarmArgumentError,
|
|
86
|
+
"`:zombie_ttl` argument should be a positive Integer, got #{zombie_ttl.inspect}."
|
|
87
|
+
)
|
|
88
|
+
end
|
|
89
|
+
|
|
80
90
|
RedisQueuedLocks::Swarm::Acquirers.acquirers(
|
|
81
91
|
rql_client.redis_client,
|
|
82
92
|
zombie_ttl
|
|
@@ -104,12 +114,32 @@ class RedisQueuedLocks::Swarm
|
|
|
104
114
|
#
|
|
105
115
|
# @api public
|
|
106
116
|
# @since 1.9.0
|
|
107
|
-
# @version 1.
|
|
117
|
+
# @version 1.21.0
|
|
108
118
|
def flush_zombies(
|
|
109
119
|
zombie_ttl: rql_client.config['swarm.flush_zombies.zombie_ttl'],
|
|
110
120
|
lock_scan_size: rql_client.config['swarm.flush_zombies.zombie_lock_scan_size'],
|
|
111
121
|
queue_scan_size: rql_client.config['swarm.flush_zombies.zombie_queue_scan_size']
|
|
112
122
|
)
|
|
123
|
+
# NOTE: (arguments) the same ranges as the config keys;
|
|
124
|
+
if !zombie_ttl.is_a?(::Integer) || zombie_ttl <= 0
|
|
125
|
+
raise(
|
|
126
|
+
RedisQueuedLocks::SwarmArgumentError,
|
|
127
|
+
"`:zombie_ttl` argument should be a positive Integer, got #{zombie_ttl.inspect}."
|
|
128
|
+
)
|
|
129
|
+
end
|
|
130
|
+
if !lock_scan_size.is_a?(::Integer) || lock_scan_size <= 0
|
|
131
|
+
raise(
|
|
132
|
+
RedisQueuedLocks::SwarmArgumentError,
|
|
133
|
+
"`:lock_scan_size` argument should be a positive Integer, got #{lock_scan_size.inspect}."
|
|
134
|
+
)
|
|
135
|
+
end
|
|
136
|
+
if !queue_scan_size.is_a?(::Integer) || queue_scan_size <= 0
|
|
137
|
+
raise(
|
|
138
|
+
RedisQueuedLocks::SwarmArgumentError,
|
|
139
|
+
"`:queue_scan_size` argument should be a positive Integer, got #{queue_scan_size.inspect}."
|
|
140
|
+
)
|
|
141
|
+
end
|
|
142
|
+
|
|
113
143
|
RedisQueuedLocks::Swarm::FlushZombies.flush_zombies(
|
|
114
144
|
rql_client.redis_client,
|
|
115
145
|
zombie_ttl,
|
|
@@ -125,11 +155,25 @@ class RedisQueuedLocks::Swarm
|
|
|
125
155
|
#
|
|
126
156
|
# @api public
|
|
127
157
|
# @since 1.9.0
|
|
128
|
-
# @version 1.
|
|
158
|
+
# @version 1.21.0
|
|
129
159
|
def zombie_locks(
|
|
130
160
|
zombie_ttl: rql_client.config['swarm.flush_zombies.zombie_ttl'],
|
|
131
161
|
lock_scan_size: rql_client.config['swarm.flush_zombies.zombie_lock_scan_size']
|
|
132
162
|
)
|
|
163
|
+
# NOTE: (arguments) the same ranges as the config keys;
|
|
164
|
+
if !zombie_ttl.is_a?(::Integer) || zombie_ttl <= 0
|
|
165
|
+
raise(
|
|
166
|
+
RedisQueuedLocks::SwarmArgumentError,
|
|
167
|
+
"`:zombie_ttl` argument should be a positive Integer, got #{zombie_ttl.inspect}."
|
|
168
|
+
)
|
|
169
|
+
end
|
|
170
|
+
if !lock_scan_size.is_a?(::Integer) || lock_scan_size <= 0
|
|
171
|
+
raise(
|
|
172
|
+
RedisQueuedLocks::SwarmArgumentError,
|
|
173
|
+
"`:lock_scan_size` argument should be a positive Integer, got #{lock_scan_size.inspect}."
|
|
174
|
+
)
|
|
175
|
+
end
|
|
176
|
+
|
|
133
177
|
RedisQueuedLocks::Swarm::ZombieInfo.zombie_locks(
|
|
134
178
|
rql_client.redis_client,
|
|
135
179
|
zombie_ttl,
|
|
@@ -142,13 +186,27 @@ class RedisQueuedLocks::Swarm
|
|
|
142
186
|
# @option lock_scan_size [Integer]
|
|
143
187
|
# @return [Set<String>]
|
|
144
188
|
#
|
|
145
|
-
# @api
|
|
189
|
+
# @api public
|
|
146
190
|
# @since 1.9.0
|
|
147
|
-
# @version 1.
|
|
191
|
+
# @version 1.21.0
|
|
148
192
|
def zombie_acquirers(
|
|
149
193
|
zombie_ttl: rql_client.config['swarm.flush_zombies.zombie_ttl'],
|
|
150
194
|
lock_scan_size: rql_client.config['swarm.flush_zombies.zombie_lock_scan_size']
|
|
151
195
|
)
|
|
196
|
+
# NOTE: (arguments) the same ranges as the config keys;
|
|
197
|
+
if !zombie_ttl.is_a?(::Integer) || zombie_ttl <= 0
|
|
198
|
+
raise(
|
|
199
|
+
RedisQueuedLocks::SwarmArgumentError,
|
|
200
|
+
"`:zombie_ttl` argument should be a positive Integer, got #{zombie_ttl.inspect}."
|
|
201
|
+
)
|
|
202
|
+
end
|
|
203
|
+
if !lock_scan_size.is_a?(::Integer) || lock_scan_size <= 0
|
|
204
|
+
raise(
|
|
205
|
+
RedisQueuedLocks::SwarmArgumentError,
|
|
206
|
+
"`:lock_scan_size` argument should be a positive Integer, got #{lock_scan_size.inspect}."
|
|
207
|
+
)
|
|
208
|
+
end
|
|
209
|
+
|
|
152
210
|
RedisQueuedLocks::Swarm::ZombieInfo.zombie_acquirers(
|
|
153
211
|
rql_client.redis_client,
|
|
154
212
|
zombie_ttl,
|
|
@@ -162,7 +220,16 @@ class RedisQueuedLocks::Swarm
|
|
|
162
220
|
#
|
|
163
221
|
# @api public
|
|
164
222
|
# @since 1.9.0
|
|
223
|
+
# @version 1.21.0
|
|
165
224
|
def zombie_hosts(zombie_ttl: rql_client.config['swarm.flush_zombies.zombie_ttl'])
|
|
225
|
+
# NOTE: (arguments) the same ranges as the config keys;
|
|
226
|
+
if !zombie_ttl.is_a?(::Integer) || zombie_ttl <= 0
|
|
227
|
+
raise(
|
|
228
|
+
RedisQueuedLocks::SwarmArgumentError,
|
|
229
|
+
"`:zombie_ttl` argument should be a positive Integer, got #{zombie_ttl.inspect}."
|
|
230
|
+
)
|
|
231
|
+
end
|
|
232
|
+
|
|
166
233
|
RedisQueuedLocks::Swarm::ZombieInfo.zombie_hosts(rql_client.redis_client, zombie_ttl)
|
|
167
234
|
end
|
|
168
235
|
|
|
@@ -172,11 +239,25 @@ class RedisQueuedLocks::Swarm
|
|
|
172
239
|
#
|
|
173
240
|
# @api public
|
|
174
241
|
# @since 1.9.0
|
|
175
|
-
# @version 1.
|
|
242
|
+
# @version 1.21.0
|
|
176
243
|
def zombies_info(
|
|
177
244
|
zombie_ttl: rql_client.config['swarm.flush_zombies.zombie_ttl'],
|
|
178
245
|
lock_scan_size: rql_client.config['swarm.flush_zombies.zombie_lock_scan_size']
|
|
179
246
|
)
|
|
247
|
+
# NOTE: (arguments) the same ranges as the config keys;
|
|
248
|
+
if !zombie_ttl.is_a?(::Integer) || zombie_ttl <= 0
|
|
249
|
+
raise(
|
|
250
|
+
RedisQueuedLocks::SwarmArgumentError,
|
|
251
|
+
"`:zombie_ttl` argument should be a positive Integer, got #{zombie_ttl.inspect}."
|
|
252
|
+
)
|
|
253
|
+
end
|
|
254
|
+
if !lock_scan_size.is_a?(::Integer) || lock_scan_size <= 0
|
|
255
|
+
raise(
|
|
256
|
+
RedisQueuedLocks::SwarmArgumentError,
|
|
257
|
+
"`:lock_scan_size` argument should be a positive Integer, got #{lock_scan_size.inspect}."
|
|
258
|
+
)
|
|
259
|
+
end
|
|
260
|
+
|
|
180
261
|
RedisQueuedLocks::Swarm::ZombieInfo.zombies_info(
|
|
181
262
|
rql_client.redis_client,
|
|
182
263
|
zombie_ttl,
|
|
@@ -70,6 +70,20 @@ module RedisQueuedLocks
|
|
|
70
70
|
Integer|Float hold_time,
|
|
71
71
|
untyped? instrument
|
|
72
72
|
) -> void
|
|
73
|
+
|
|
74
|
+
def self.lock_obtaining_failed: (
|
|
75
|
+
RQL::instrObj instrumenter,
|
|
76
|
+
bool instr_sampled,
|
|
77
|
+
String lock_key,
|
|
78
|
+
Symbol rw_mode,
|
|
79
|
+
Integer ttl,
|
|
80
|
+
String acq_id,
|
|
81
|
+
String hst_id,
|
|
82
|
+
Integer|Float ts,
|
|
83
|
+
Integer|Float acq_time,
|
|
84
|
+
Symbol result,
|
|
85
|
+
untyped? instrument
|
|
86
|
+
) -> void
|
|
73
87
|
end
|
|
74
88
|
end
|
|
75
89
|
end
|
|
@@ -72,6 +72,19 @@ module RedisQueuedLocks
|
|
|
72
72
|
Symbol access_strategy,
|
|
73
73
|
Symbol rw_mode
|
|
74
74
|
) -> void
|
|
75
|
+
|
|
76
|
+
def self.lock_obtaining_failed: (
|
|
77
|
+
RQL::loggerObj logger,
|
|
78
|
+
bool log_sampled,
|
|
79
|
+
String lock_key,
|
|
80
|
+
Integer queue_ttl,
|
|
81
|
+
String acquirer_id,
|
|
82
|
+
String host_id,
|
|
83
|
+
Integer|Float acq_time,
|
|
84
|
+
Symbol access_strategy,
|
|
85
|
+
Symbol rw_mode,
|
|
86
|
+
Symbol result
|
|
87
|
+
) -> void
|
|
75
88
|
end
|
|
76
89
|
end
|
|
77
90
|
end
|
|
@@ -19,7 +19,7 @@ module RedisQueuedLocks
|
|
|
19
19
|
Symbol access_strategy,
|
|
20
20
|
bool timed,
|
|
21
21
|
Integer|Float ttl_shift,
|
|
22
|
-
Integer
|
|
22
|
+
Integer ttl,
|
|
23
23
|
Integer queue_ttl,
|
|
24
24
|
Hash[String|Symbol,untyped]? meta,
|
|
25
25
|
bool log_sampled,
|
|
@@ -33,7 +33,7 @@ module RedisQueuedLocks
|
|
|
33
33
|
def yield_with_timeout: (
|
|
34
34
|
Float timeout,
|
|
35
35
|
String lock_key,
|
|
36
|
-
Integer
|
|
36
|
+
Integer lock_ttl,
|
|
37
37
|
String acquirer_id,
|
|
38
38
|
String host_id,
|
|
39
39
|
Hash[String|Symbol,untyped]? meta,
|
|
@@ -4,6 +4,8 @@ use RedisClient as RC
|
|
|
4
4
|
module RedisQueuedLocks
|
|
5
5
|
module Acquirer
|
|
6
6
|
module ClearDeadRequests
|
|
7
|
+
extend RQL::Utilities
|
|
8
|
+
|
|
7
9
|
type clearResult = { ok: bool, result: { processed_queues: Set[String] } }
|
|
8
10
|
def self.clear_dead_requests: (
|
|
9
11
|
RC::client redis_client,
|
|
@@ -23,6 +25,13 @@ module RedisQueuedLocks
|
|
|
23
25
|
bool instr_sample_this
|
|
24
26
|
) -> clearResult
|
|
25
27
|
|
|
28
|
+
private def self.fully_clear_dead_requests: (
|
|
29
|
+
RC::client redis_client,
|
|
30
|
+
Integer scan_size,
|
|
31
|
+
Integer dead_ttl,
|
|
32
|
+
bool lock_index_enabled
|
|
33
|
+
) -> Set[String]
|
|
34
|
+
|
|
26
35
|
private def self.each_lock_queue: (RC::client redis_client, Integer scan_size) { (String lock_queue) -> void } -> void
|
|
27
36
|
private def self.drop_dead_requests: (RC::client redis_client, Array[String] lock_queues, Float dead_score) -> void
|
|
28
37
|
private def self.drop_dead_requests_of_locks: (
|
|
@@ -4,6 +4,8 @@ use RedisClient as RC
|
|
|
4
4
|
module RedisQueuedLocks
|
|
5
5
|
module Acquirer
|
|
6
6
|
module ExtendLockTTL
|
|
7
|
+
extend RQL::Utilities
|
|
8
|
+
|
|
7
9
|
EXTEND_LOCK_PTTL: String
|
|
8
10
|
|
|
9
11
|
type extendResult = { ok: bool, result: { extended_locks_count: Integer } | Symbol }
|
|
@@ -18,16 +20,27 @@ module RedisQueuedLocks
|
|
|
18
20
|
RQL::loggerObj logger,
|
|
19
21
|
RQL::instrObj instrumenter,
|
|
20
22
|
untyped? instrument,
|
|
21
|
-
bool
|
|
23
|
+
bool log_sampling_enabled,
|
|
22
24
|
Integer log_sampling_percent,
|
|
23
25
|
RQL::Logging::samplerObj log_sampler,
|
|
24
|
-
bool
|
|
26
|
+
bool log_sample_this,
|
|
25
27
|
bool instr_sampling_enabled,
|
|
26
28
|
Integer instr_sampling_percent,
|
|
27
29
|
RQL::Instrument::samplerObj instr_sampler,
|
|
28
30
|
bool instr_sample_this
|
|
29
31
|
) -> extendResult
|
|
30
32
|
|
|
33
|
+
private def self.fully_extend_lock_ttl: (
|
|
34
|
+
RC::client redis_client,
|
|
35
|
+
String lock_name,
|
|
36
|
+
String lock_key,
|
|
37
|
+
Integer milliseconds,
|
|
38
|
+
Symbol read_write_mode,
|
|
39
|
+
bool all_read_locks,
|
|
40
|
+
String acquirer_id,
|
|
41
|
+
bool lock_index_enabled
|
|
42
|
+
) -> extendResult
|
|
43
|
+
|
|
31
44
|
private def self.extend_read_lock_ttl: (
|
|
32
45
|
RC::client redis_client,
|
|
33
46
|
String lock_name,
|
|
@@ -1,16 +1,37 @@
|
|
|
1
|
+
use RedisQueuedLocks as RQL
|
|
1
2
|
use RedisClient as RC
|
|
2
3
|
|
|
3
4
|
module RedisQueuedLocks
|
|
4
5
|
module Acquirer
|
|
5
6
|
module ReindexLocks
|
|
7
|
+
extend RQL::Utilities
|
|
8
|
+
|
|
6
9
|
type reindexResult = { ok: bool, result: { idx_key_cnt: Integer } }
|
|
7
10
|
def self.reindex_locks: (
|
|
8
11
|
RC::client redis_client,
|
|
9
12
|
Integer scan_size,
|
|
10
13
|
Integer queue_ttl,
|
|
11
|
-
Integer lock_index_grace_period
|
|
14
|
+
Integer lock_index_grace_period,
|
|
15
|
+
RQL::loggerObj logger,
|
|
16
|
+
RQL::instrObj instrumenter,
|
|
17
|
+
untyped? instrument,
|
|
18
|
+
bool log_sampling_enabled,
|
|
19
|
+
Integer log_sampling_percent,
|
|
20
|
+
RQL::Logging::samplerObj log_sampler,
|
|
21
|
+
bool log_sample_this,
|
|
22
|
+
bool instr_sampling_enabled,
|
|
23
|
+
Integer instr_sampling_percent,
|
|
24
|
+
RQL::Instrument::samplerObj instr_sampler,
|
|
25
|
+
bool instr_sample_this
|
|
12
26
|
) -> reindexResult
|
|
13
27
|
|
|
28
|
+
private def self.fully_reindex_locks: (
|
|
29
|
+
RC::client redis_client,
|
|
30
|
+
Integer scan_size,
|
|
31
|
+
Integer queue_ttl,
|
|
32
|
+
Integer lock_index_grace_period
|
|
33
|
+
) -> Integer
|
|
34
|
+
|
|
14
35
|
private def self.index_lock_keys: (
|
|
15
36
|
RC::client redis_client,
|
|
16
37
|
Array[String] lock_keys,
|
|
@@ -20,10 +20,11 @@ module RedisQueuedLocks
|
|
|
20
20
|
RC::client redis,
|
|
21
21
|
String lock_name,
|
|
22
22
|
bool lock_index_enabled,
|
|
23
|
-
RQL::instrObj instrumenter,
|
|
24
23
|
RQL::loggerObj logger,
|
|
24
|
+
RQL::instrObj instrumenter,
|
|
25
|
+
untyped? instrument,
|
|
25
26
|
bool log_sampling_enabled,
|
|
26
|
-
Integer
|
|
27
|
+
Integer log_sampling_percent,
|
|
27
28
|
RQL::Logging::samplerObj log_sampler,
|
|
28
29
|
bool log_sample_this,
|
|
29
30
|
bool instr_sampling_enabled,
|
|
@@ -19,8 +19,8 @@ module RedisQueuedLocks
|
|
|
19
19
|
RC::client redis,
|
|
20
20
|
String lock_name,
|
|
21
21
|
String acquirer_id,
|
|
22
|
-
RQL::instrObj instrumenter,
|
|
23
22
|
RQL::loggerObj logger,
|
|
23
|
+
RQL::instrObj instrumenter,
|
|
24
24
|
untyped? instrument,
|
|
25
25
|
bool log_sampling_enabled,
|
|
26
26
|
Integer log_sampling_percent,
|
|
@@ -141,7 +141,7 @@ module RedisQueuedLocks
|
|
|
141
141
|
?ractor_id: Integer|String,
|
|
142
142
|
?identity: String
|
|
143
143
|
) -> String
|
|
144
|
-
alias
|
|
144
|
+
alias current_acq_id current_acquirer_id
|
|
145
145
|
alias acq_id current_acquirer_id
|
|
146
146
|
|
|
147
147
|
def current_host_id: (
|
|
@@ -236,7 +236,7 @@ module RedisQueuedLocks
|
|
|
236
236
|
| (?scan_size: Integer, ?with_info: true) -> RQL::Acquirer::Queues::queuesInfo
|
|
237
237
|
| (?scan_size: Integer, ?with_info: false) -> RQL::Acquirer::Queues::queueList
|
|
238
238
|
|
|
239
|
-
def queues_info: (?scan_size: Integer) -> RQL::Acquirer::Queues::
|
|
239
|
+
def queues_info: (?scan_size: Integer) -> RQL::Acquirer::Queues::queuesInfo
|
|
240
240
|
def keys: (?scan_size: Integer) -> RQL::Acquirer::Keys::keyList
|
|
241
241
|
|
|
242
242
|
def clear_dead_requests: (
|
|
@@ -258,7 +258,18 @@ module RedisQueuedLocks
|
|
|
258
258
|
def reindex_locks: (
|
|
259
259
|
?scan_size: Integer,
|
|
260
260
|
?queue_ttl: Integer,
|
|
261
|
-
?lock_index_grace_period: Integer
|
|
261
|
+
?lock_index_grace_period: Integer,
|
|
262
|
+
?logger: RQL::loggerObj,
|
|
263
|
+
?instrumenter: RQL::instrObj,
|
|
264
|
+
?instrument: untyped?,
|
|
265
|
+
?log_sampling_enabled: bool,
|
|
266
|
+
?log_sampling_percent: Integer,
|
|
267
|
+
?log_sampler: RQL::Logging::samplerObj,
|
|
268
|
+
?log_sample_this: bool,
|
|
269
|
+
?instr_sampling_enabled: bool,
|
|
270
|
+
?instr_sampling_percent: Integer,
|
|
271
|
+
?instr_sampler: RQL::Instrument::samplerObj,
|
|
272
|
+
?instr_sample_this: bool
|
|
262
273
|
) -> RQL::Acquirer::ReindexLocks::reindexResult
|
|
263
274
|
end
|
|
264
275
|
end
|
|
@@ -5,10 +5,13 @@ module RedisQueuedLocks
|
|
|
5
5
|
class ArgumentError < ::ArgumentError
|
|
6
6
|
end
|
|
7
7
|
|
|
8
|
+
class Exception < ::Exception
|
|
9
|
+
end
|
|
10
|
+
|
|
8
11
|
class LockAlreadyObtainedError < Error
|
|
9
12
|
end
|
|
10
13
|
|
|
11
|
-
class LockAcquirementIntermediateTimeoutError <
|
|
14
|
+
class LockAcquirementIntermediateTimeoutError < Exception
|
|
12
15
|
end
|
|
13
16
|
|
|
14
17
|
class LockAcquirementTimeoutError < Error
|
|
@@ -17,7 +20,7 @@ module RedisQueuedLocks
|
|
|
17
20
|
class LockAcquirementRetryLimitError < Error
|
|
18
21
|
end
|
|
19
22
|
|
|
20
|
-
class TimedLockIntermediateTimeoutError <
|
|
23
|
+
class TimedLockIntermediateTimeoutError < Exception
|
|
21
24
|
end
|
|
22
25
|
|
|
23
26
|
class TimedLockTimeoutError < Error
|
|
@@ -45,7 +45,7 @@ module RedisQueuedLocks
|
|
|
45
45
|
def self.acquirer_dead_score: (Integer|Float queue_ttl) -> Float
|
|
46
46
|
def self.calc_zombie_score: (Float zombie_ttl) -> Float
|
|
47
47
|
def self.dead_score_reached?: (Float acquirer_position, Integer queue_ttl) -> bool
|
|
48
|
-
def self.lock_key_from_queue: (String lock_queue) -> String
|
|
48
|
+
def self.lock_key_from_queue: (String lock_queue) -> String?
|
|
49
49
|
def self.get_thread_id: () -> Integer
|
|
50
50
|
def self.get_fiber_id: () -> Integer
|
|
51
51
|
def self.get_ractor_id: () -> Integer
|
data/sig/vendor/redis_client.rbs
CHANGED
|
@@ -6,6 +6,7 @@ class RedisClient
|
|
|
6
6
|
def zscan: (String key, *untyped) { (String member, String score) -> untyped } -> untyped
|
|
7
7
|
def multi: (?watch: Array[String]) { (Multi transact) -> untyped } -> untyped
|
|
8
8
|
def with: (?untyped) { (::RedisClient|::RedisClient::Pooled rconn) -> untyped } -> untyped
|
|
9
|
+
def close: () -> void
|
|
9
10
|
end
|
|
10
11
|
|
|
11
12
|
include _Client
|