redis_queued_locks 1.19.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 +96 -23
- data/.claude/rules/acquirer.md +39 -20
- data/.claude/rules/arguments.md +3 -2
- data/.claude/rules/git.md +3 -2
- data/.claude/rules/logic.md +32 -8
- data/.claude/rules/swarm.md +14 -9
- data/.claude/rules/tests.md +12 -3
- data/.claude/rules/type-checking.md +2 -1
- data/.claude/rules/visitors.md +10 -11
- data/.claude/skills/rql-code-review/SKILL.md +386 -0
- data/.claude/skills/rql-code-review/templates/report.en.md +31 -0
- data/.claude/skills/rql-code-review/templates/report.ru.md +31 -0
- data/CHANGELOG.md +194 -0
- data/CLAUDE.md +6 -3
- data/README.md +502 -92
- 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 +695 -128
- 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 +8 -6
- data/lib/redis_queued_locks/acquirer/acquire_lock.rb +134 -26
- data/lib/redis_queued_locks/acquirer/clear_dead_requests.rb +229 -24
- data/lib/redis_queued_locks/acquirer/extend_lock_ttl.rb +189 -18
- 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 +151 -7
- data/lib/redis_queued_locks/acquirer/lock_info.rb +39 -41
- 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 +79 -20
- data/lib/redis_queued_locks/acquirer/locks.rb +212 -83
- data/lib/redis_queued_locks/acquirer/queue_info.rb +11 -18
- data/lib/redis_queued_locks/acquirer/queues.rb +123 -50
- data/lib/redis_queued_locks/acquirer/reindex_locks.rb +253 -0
- data/lib/redis_queued_locks/acquirer/release_all_locks.rb +177 -61
- data/lib/redis_queued_locks/acquirer/release_lock.rb +84 -25
- data/lib/redis_queued_locks/acquirer/release_locks_of.rb +274 -70
- data/lib/redis_queued_locks/acquirer/release_read_lock.rb +22 -3
- data/lib/redis_queued_locks/acquirer.rb +1 -0
- data/lib/redis_queued_locks/client.rb +164 -36
- data/lib/redis_queued_locks/config.rb +16 -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 +113 -6
- data/lib/redis_queued_locks/swarm/flush_zombies.rb +333 -61
- 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/zombie_info.rb +203 -53
- data/lib/redis_queued_locks/swarm.rb +97 -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/try_to_lock.rbs +107 -1
- data/sig/redis_queued_locks/acquirer/acquire_lock/yield_expire.rbs +3 -3
- data/sig/redis_queued_locks/acquirer/acquire_lock.rbs +3 -1
- data/sig/redis_queued_locks/acquirer/clear_dead_requests.rbs +19 -1
- data/sig/redis_queued_locks/acquirer/extend_lock_ttl.rbs +20 -4
- data/sig/redis_queued_locks/acquirer/keys.rbs +11 -1
- data/sig/redis_queued_locks/acquirer/locks.rbs +15 -6
- data/sig/redis_queued_locks/acquirer/queues.rbs +9 -2
- data/sig/redis_queued_locks/acquirer/reindex_locks.rbs +52 -0
- data/sig/redis_queued_locks/acquirer/release_all_locks.rbs +8 -1
- data/sig/redis_queued_locks/acquirer/release_lock.rbs +6 -3
- data/sig/redis_queued_locks/acquirer/release_locks_of.rbs +20 -1
- data/sig/redis_queued_locks/acquirer/release_read_lock.rbs +1 -1
- data/sig/redis_queued_locks/client.rbs +21 -2
- 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 +7 -1
- data/sig/redis_queued_locks/swarm/flush_zombies.rbs +51 -1
- data/sig/redis_queued_locks/swarm/zombie_info.rbs +58 -7
- data/sig/vendor/redis_client.rbs +2 -0
- metadata +6 -1
|
@@ -4,25 +4,76 @@ module RedisQueuedLocks
|
|
|
4
4
|
class Swarm
|
|
5
5
|
module ZombieInfo
|
|
6
6
|
type zombieInfo = { zombie_hosts: Set[String], zombie_acquirers: Set[String], zombie_locks: Set[String] }
|
|
7
|
-
def self.zombies_info: (
|
|
7
|
+
def self.zombies_info: (
|
|
8
|
+
RC::client redis_client,
|
|
9
|
+
Integer zombie_ttl,
|
|
10
|
+
Integer lock_scan_size,
|
|
11
|
+
bool lock_index_enabled
|
|
12
|
+
) -> zombieInfo
|
|
8
13
|
|
|
9
14
|
type zombieLocks = Set[String]
|
|
10
|
-
def self.zombie_locks: (
|
|
15
|
+
def self.zombie_locks: (
|
|
16
|
+
RC::client redis_client,
|
|
17
|
+
Integer zombie_ttl,
|
|
18
|
+
Integer lock_scan_size,
|
|
19
|
+
bool lock_index_enabled
|
|
20
|
+
) -> zombieLocks
|
|
11
21
|
|
|
12
22
|
type zombieHosts = Set[String]
|
|
13
23
|
def self.zombie_hosts: (RC::client redis_client, Integer zombie_ttl) -> zombieHosts
|
|
14
24
|
|
|
15
25
|
type zombieAcquirers = Set[String]
|
|
16
|
-
def self.zombie_acquirers: (
|
|
26
|
+
def self.zombie_acquirers: (
|
|
27
|
+
RC::client redis_client,
|
|
28
|
+
Integer zombie_ttl,
|
|
29
|
+
Integer lock_scan_size,
|
|
30
|
+
bool lock_index_enabled
|
|
31
|
+
) -> zombieAcquirers
|
|
17
32
|
|
|
18
33
|
private def self.extract_zombie_hosts: (RC::client rconn, Integer zombie_ttl) -> zombieHosts
|
|
19
|
-
private def self.extract_zombie_locks: (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
34
|
+
private def self.extract_zombie_locks: (
|
|
35
|
+
RC::client rconn,
|
|
36
|
+
Integer zombie_ttl,
|
|
37
|
+
Integer lock_scan_size,
|
|
38
|
+
bool lock_index_enabled
|
|
39
|
+
) -> zombieLocks
|
|
40
|
+
private def self.extract_zombie_acquirers: (
|
|
41
|
+
RC::client rconn,
|
|
42
|
+
Integer zombie_ttl,
|
|
43
|
+
Integer lock_scan_size,
|
|
44
|
+
bool lock_index_enabled
|
|
45
|
+
) -> zombieAcquirers
|
|
46
|
+
private def self.extract_all: (
|
|
47
|
+
RC::client rconn,
|
|
48
|
+
Integer zombie_ttl,
|
|
49
|
+
Integer lock_scan_size,
|
|
50
|
+
bool lock_index_enabled
|
|
51
|
+
) -> zombieInfo
|
|
52
|
+
private def self.each_zombie_lock: (
|
|
53
|
+
RC::client rconn,
|
|
54
|
+
Set[String] zombie_hosts,
|
|
55
|
+
Integer lock_scan_size,
|
|
56
|
+
bool lock_index_enabled
|
|
57
|
+
) { (String lock_key, String acquirer_id) -> void } -> void
|
|
58
|
+
private def self.each_keyspace_zombie_lock: (
|
|
23
59
|
RC::client rconn,
|
|
24
60
|
Set[String] zombie_hosts,
|
|
25
61
|
Integer lock_scan_size
|
|
62
|
+
) { (String lock_key, String acquirer_id) -> void } -> void
|
|
63
|
+
private def self.each_lock_index_zombie_lock: (
|
|
64
|
+
RC::client rconn,
|
|
65
|
+
Set[String] zombie_hosts,
|
|
66
|
+
Integer lock_scan_size
|
|
67
|
+
) { (String lock_key, String acquirer_id) -> void } -> void
|
|
68
|
+
private def self.each_zombie_write_lock: (
|
|
69
|
+
RC::client rconn,
|
|
70
|
+
Array[String] lock_keys,
|
|
71
|
+
Set[String] zombie_hosts
|
|
72
|
+
) { (String lock_key, String acquirer_id) -> void } -> void
|
|
73
|
+
private def self.each_zombie_read_lock: (
|
|
74
|
+
RC::client rconn,
|
|
75
|
+
Array[String] lock_readers_keys,
|
|
76
|
+
Set[String] zombie_hosts
|
|
26
77
|
) { (String lock_readers_key, String acquirer_id) -> void } -> void
|
|
27
78
|
end
|
|
28
79
|
end
|
data/sig/vendor/redis_client.rbs
CHANGED
|
@@ -3,8 +3,10 @@ class RedisClient
|
|
|
3
3
|
def call: (*untyped) -> untyped
|
|
4
4
|
def pipelined: () { (Pipeline pipeline) -> untyped } -> untyped
|
|
5
5
|
def scan: (*untyped) { (String key) -> untyped } -> untyped
|
|
6
|
+
def zscan: (String key, *untyped) { (String member, String score) -> untyped } -> untyped
|
|
6
7
|
def multi: (?watch: Array[String]) { (Multi transact) -> untyped } -> untyped
|
|
7
8
|
def with: (?untyped) { (::RedisClient|::RedisClient::Pooled rconn) -> untyped } -> untyped
|
|
9
|
+
def close: () -> void
|
|
8
10
|
end
|
|
9
11
|
|
|
10
12
|
include _Client
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: redis_queued_locks
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.21.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rustam Ibragimov
|
|
@@ -44,6 +44,9 @@ files:
|
|
|
44
44
|
- ".claude/rules/tests.md"
|
|
45
45
|
- ".claude/rules/type-checking.md"
|
|
46
46
|
- ".claude/rules/visitors.md"
|
|
47
|
+
- ".claude/skills/rql-code-review/SKILL.md"
|
|
48
|
+
- ".claude/skills/rql-code-review/templates/report.en.md"
|
|
49
|
+
- ".claude/skills/rql-code-review/templates/report.ru.md"
|
|
47
50
|
- ".rspec"
|
|
48
51
|
- ".rubocop.rbs.yml"
|
|
49
52
|
- ".rubocop.yml"
|
|
@@ -81,6 +84,7 @@ files:
|
|
|
81
84
|
- lib/redis_queued_locks/acquirer/locks.rb
|
|
82
85
|
- lib/redis_queued_locks/acquirer/queue_info.rb
|
|
83
86
|
- lib/redis_queued_locks/acquirer/queues.rb
|
|
87
|
+
- lib/redis_queued_locks/acquirer/reindex_locks.rb
|
|
84
88
|
- lib/redis_queued_locks/acquirer/release_all_locks.rb
|
|
85
89
|
- lib/redis_queued_locks/acquirer/release_lock.rb
|
|
86
90
|
- lib/redis_queued_locks/acquirer/release_locks_of.rb
|
|
@@ -139,6 +143,7 @@ files:
|
|
|
139
143
|
- sig/redis_queued_locks/acquirer/locks.rbs
|
|
140
144
|
- sig/redis_queued_locks/acquirer/queue_info.rbs
|
|
141
145
|
- sig/redis_queued_locks/acquirer/queues.rbs
|
|
146
|
+
- sig/redis_queued_locks/acquirer/reindex_locks.rbs
|
|
142
147
|
- sig/redis_queued_locks/acquirer/release_all_locks.rbs
|
|
143
148
|
- sig/redis_queued_locks/acquirer/release_lock.rbs
|
|
144
149
|
- sig/redis_queued_locks/acquirer/release_locks_of.rbs
|