redis_queued_locks 1.12.0 → 1.13.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 +4 -1
- data/.ruby-version +1 -1
- data/CHANGELOG.md +42 -5
- data/LICENSE.txt +1 -1
- data/README.md +231 -203
- data/Rakefile +12 -4
- data/Steepfile +16 -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 -13
- 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 +43 -20
- data/lib/redis_queued_locks/{acquier → acquirer}/acquire_lock.rb +69 -42
- 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 +23 -18
- data/lib/redis_queued_locks/{acquier → acquirer}/release_lock.rb +25 -19
- data/lib/redis_queued_locks/acquirer.rb +18 -0
- data/lib/redis_queued_locks/client.rb +164 -254
- data/lib/redis_queued_locks/config/dsl.rb +94 -0
- data/lib/redis_queued_locks/config.rb +231 -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/lock.rb +4 -2
- data/lib/redis_queued_locks/utilities.rb +2 -2
- data/lib/redis_queued_locks/version.rb +2 -2
- data/lib/redis_queued_locks.rb +2 -2
- data/rbs_collection.lock.yaml +40 -0
- data/rbs_collection.yaml +16 -0
- data/redis_queued_locks.gemspec +22 -23
- data/sig/manifest.yml +7 -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 +51 -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/client.rbs +195 -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 +11 -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 +96 -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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 306e86a36b29ee294af7e0ee9eda0c3815e1b646733abf3f30e25c4f0d3f0394
|
4
|
+
data.tar.gz: 1f4b4d1b762f4c27aab1bfae415c2f183593ab5a2772b07e4789d44aa0b5ea1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f48e55fece224be62a769d2eaba83fe206b3275fed1849dc000dfd75d51794a1f023af43c4a0647809fc6ee6fb8d80258e2686d9b1f59fa3ff3a0b20651db89b
|
7
|
+
data.tar.gz: 338a6748a479158d2429c57b6afab1d10682b94e1751560c595c4d9dadd0a607b1d3ea45aeb5612b003a0a88d208780e7dcdb474f05418ac817a46bb9bd16de1
|
data/.rubocop.yml
CHANGED
@@ -3,14 +3,17 @@ inherit_gem:
|
|
3
3
|
- lib/rubocop.general.yml
|
4
4
|
- lib/rubocop.rake.yml
|
5
5
|
- lib/rubocop.rspec.yml
|
6
|
+
- lib/rubocop.rbs.yml
|
6
7
|
|
7
8
|
AllCops:
|
8
|
-
TargetRubyVersion: 3.
|
9
|
+
TargetRubyVersion: 3.3
|
9
10
|
NewCops: enable
|
10
11
|
Include:
|
11
12
|
- lib/**/*.rb
|
12
13
|
- spec/**/*.rb
|
14
|
+
- sig/**/*.rbs
|
13
15
|
- Gemfile
|
16
|
+
- gemfiles/ruby3.3.gemfile
|
14
17
|
- Rakefile
|
15
18
|
- redis_queued_locks.gemspec
|
16
19
|
- bin/console
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.3
|
1
|
+
3.4.3
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,41 @@
|
|
1
1
|
## [Unreleased]
|
2
|
+
### Changed
|
3
|
+
- Updated development dependencies (`armitage-rubocop`, `rbs`, `steep`);
|
4
|
+
- Bumped development Ruby version (from `3.3.6` to `3.4.3`);
|
5
|
+
- CI is splitted to "mainstream ruby version" and "previous actually maintaned ruby versions";
|
6
|
+
- `Acquier` -> `Acquirer`, `Acquierment` -> `Acquirement` (typos):
|
7
|
+
- [**Breaking**] Constant renaming: all constants and constant parts were renamed from `Acquier` to `Acquirer`;
|
8
|
+
- [**Breaking**] Method and variable names renaming: all `acquier` text parts of method/variable names were renamed to `acquirer`;
|
9
|
+
- [**Breaking**] Logs: all `acquier` text parts of each log message type were renamed to `acquirer`;
|
10
|
+
- [**Breaking**] Instrumentation: all `acquier` text parts of each event name were renamed to `acquirer`;
|
11
|
+
- [**Breaking**] Exceptions: all `Acquierment` exception constant name parts were renamed to `Acquirement`;
|
12
|
+
- [**Breaking**] `RedisQueuedLocks::Data` is not used (**temporary**) as result type of some APIs.
|
13
|
+
The reason is that this type can not be used as a record type in `steep`/`rbs` (working on it);
|
14
|
+
- [**Breaking**] Minimal Ruby Version - **3.3** (previously - **3.1**):
|
15
|
+
- removed `3.1` and `3.2` from `CI`;
|
16
|
+
- [**Breaking**] Config layer was fully reworked in order to improve performance:
|
17
|
+
- Config API has changed from "method invocation" to "hash key/value access/assignment" with a validation layer and config-data-access wrapping;
|
18
|
+
### Added
|
19
|
+
- **Type Checking**:
|
20
|
+
- library codebase is fully typed;
|
21
|
+
- integrated `RBS` with `Steep` that is configured on **strict mode** (see `sig` directory, `Steepfile` config, `sig/manifest.yml` and `rbs_collection.yml` for dependencies);
|
22
|
+
- CI integration;
|
23
|
+
- Integrated RBS linting to `Rubocop`;
|
24
|
+
- Test coverage (via `simplecov` with `html` and `lcov` formats). `minimum_coverage` config is temporary disabled (and the CI step is not configured yet) cuz we need to refactor tests in first;
|
25
|
+
- CI:
|
26
|
+
- `rspec-retry` is temporary added until the tests are fully refactored;
|
27
|
+
- typecheck steps: `TypeCheck (Static)` (based on `steep` checks) and `TypeCheckl (Runtime)` (based on `RBS` runtime type checking/testing);
|
28
|
+
- Support for `ActiveSupport::BroadcastLogger` logger instances;
|
29
|
+
|
30
|
+
## [1.12.1]
|
31
|
+
### Changed
|
32
|
+
- Internal Private API: an internal Reentrant's Lock utility (`RedisQueuedLocks::Utilities::Lock`) basis
|
33
|
+
is changed from `::Mutex` to `::Monitor` in order to use Ruby's Core C-based
|
34
|
+
implementation (prevent some Ruby-runtime based GVL-oriented locking) of re-entrant locks
|
35
|
+
instead of the custom Ruby-based implementation;
|
36
|
+
### Fixed
|
37
|
+
- `redis_queued_locks.lock_hold_and_release` instrumentation event has incorrect `acq_time` payload value
|
38
|
+
(it incorrectly stores `lock_key` payload value);
|
2
39
|
|
3
40
|
## [1.12.0] - 2024-08-11
|
4
41
|
### Changed
|
@@ -6,7 +43,7 @@
|
|
6
43
|
|
7
44
|
## [1.11.0] - 2024-08-11
|
8
45
|
### Changed
|
9
|
-
- Lock
|
46
|
+
- Lock Acquirement Timeout (`acq_timeout`/`queue_ttl`): more correct timeout error interception
|
10
47
|
inside the `RedisQueuedLocks::Acquier::AcquireLock::WithAcqTimeout` logic that now raises and
|
11
48
|
intercepts an internal timeout error class in order to prevent interceptions of
|
12
49
|
other timeouts that can be raised from the wrapped block of code;
|
@@ -36,7 +73,7 @@
|
|
36
73
|
- each ruby worker of the swarm probes himself that he is alive;
|
37
74
|
- worker that does not probes himselfs treats as a zombie;
|
38
75
|
- worekr becomes dead when your ruby process is dead, or thread is dead or your ractor is dead;
|
39
|
-
- each zombie's lock,
|
76
|
+
- each zombie's lock, acquirer and position in queue are flushed in background via `flush_zombies` swarm element;
|
40
77
|
- the supervisor module keeps up and running each swarm melement (`probe_hosts` and `flush_zombies`):
|
41
78
|
- cuz each element works in background and can fail by any unexpected exception the supervisor guarantees that your elements will ressurect after that;
|
42
79
|
- each element can be deeply configured (and enabled/disabled);
|
@@ -47,7 +84,7 @@
|
|
47
84
|
- supervisor that keeps all elements running and wokring;
|
48
85
|
- an ability to check the swarm status (`#swarm_status`): who is working, who is dead, running status, internal main loop states, etc;
|
49
86
|
- an abiltiy to check the swarm information (`#swarm_info`): showing the current swarm hosts and their last probes and current zombie status;
|
50
|
-
- an ability to find zombie locks, zombie
|
87
|
+
- an ability to find zombie locks, zombie acquirers and zombie hosts (`#zombie_locks`, `#zombie_acquiers`, `#zombie_hosts`);
|
51
88
|
- an ability to extract the full zombie information (`#zombies_info`/`#zombies`);
|
52
89
|
- each zombie lock will be flushed in background by appropriated swarm element (`flush_zombies`);
|
53
90
|
- deeply configurable zombie factors: zombie ttl, host probing period, supervisor check period;
|
@@ -246,7 +283,7 @@
|
|
246
283
|
|
247
284
|
## [0.0.27] - 2024-03-21
|
248
285
|
### Changed
|
249
|
-
- Better
|
286
|
+
- Better acquirer position accuracy: acquirer position in lock queue
|
250
287
|
should be represented as EPOCH in seconds+microseconds (previously: simply in seconds);
|
251
288
|
|
252
289
|
## [0.0.26] - 2024-03-21
|
@@ -325,7 +362,7 @@
|
|
325
362
|
|
326
363
|
## [0.0.9] - 2024-02-27
|
327
364
|
### Changed
|
328
|
-
- The lock
|
365
|
+
- The lock acquirer identifier (`acq_id`) now includes the fiber id, the ractor id and an unique per-process
|
329
366
|
10 byte string. It is added in order to prevent collisions between different processes/pods
|
330
367
|
that will have the same process id / thread id identifiers (cuz it is an object_id integers) that can lead
|
331
368
|
to the same position with the same `acq_id` for different processes/pods in the lock request queue.
|
data/LICENSE.txt
CHANGED