redis_queued_locks 1.10.0 → 1.11.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a2028a137ac36d716a0f9728656f536c373d21691fe64bf5fa1970db160fbe51
4
- data.tar.gz: 3d065601fac650cf7d2a8fcb63745ffbf91ecd2cc553d936c693b2e45fee752f
3
+ metadata.gz: c7161dbfaa5660709705978e003201b12c4684d5c271fc700710802b10586e00
4
+ data.tar.gz: efaf7103b6bddfd708aceca2d967f282e60b6a74b43c7de2314512cdc963fd19
5
5
  SHA512:
6
- metadata.gz: e7d6698032bab56ebb0cc85abf3b13bcffe499c019708b845962bb626ac0e27d3da35c27462816c3c37d664117ba3c6a8c916dca231fb9fffdb862695cf2c261
7
- data.tar.gz: 7b139c4bff4587783dc0df0f67bc7b985569ff5590aaaa8cb4370cdf2d3f9f9954bf9c99ade1a60e47e48ac4c450b58c308dce32ab10e0e1b5a40d6003ed5019
6
+ metadata.gz: 4736b2cf3ec4fa9a121425769a5037aa78d2f5765829533fd4cb830f3e184b856d03a5fc2e7653df3a49c47975de074120f55ddc88476d78b623131ffc718f48
7
+ data.tar.gz: eb2e86d9764606a11f7c547e8e1ff6b126a26a3cbfd3ea6cff0f670625d6845a441eb7ef6ad9c0e9ce125e0f5fb983feb068205b04bb5a27b85307d5119140d9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ### [1.11.0] - 2024-08-11
4
+ ### Changed
5
+ - Lock Acquierment Timeout (`acq_timeout`/`queue_ttl`): more correct timeout error interception
6
+ inside the `RedisQueuedLocks::Acquier::AcquireLock::WithAcqTimeout` logic that now raises and
7
+ intercepts an internal timeout error class in order to prevent interceptions of
8
+ other timeouts that can be raised from the wrapped block of code;
9
+
3
10
  ## [1.10.0] - 2024-08-11
4
11
  ### Changed
5
12
  - Timed invocations (`"timeed blocks of code"` / `timed: true`):
@@ -8,6 +15,8 @@
8
15
  now uses `Timeout#timeout`'s custom exception class/message replacement API;
9
16
  - `rescue Timeout::Error` can lead to incorrect exception interception: intercept block's-related
10
17
  Timeout::Error that is not RQL-related error;
18
+ - Updated development dependencies;
19
+ - Some minor readme updates;
11
20
  ### Added
12
21
  - `RedisQueuedLocks::Swarm`: missing YARDocs;
13
22
  - Separated `Logging Configuration` readme section (that is placed inside the main configuration section already);
@@ -21,7 +21,7 @@ module RedisQueuedLocks::Acquier::AcquireLock::WithAcqTimeout
21
21
  #
22
22
  # @api private
23
23
  # @since 1.0.0
24
- # @version 1.8.0
24
+ # @version 1.11.0
25
25
  def with_acq_timeout(
26
26
  redis,
27
27
  timeout,
@@ -32,8 +32,12 @@ module RedisQueuedLocks::Acquier::AcquireLock::WithAcqTimeout
32
32
  on_timeout: nil,
33
33
  &block
34
34
  )
35
- ::Timeout.timeout(timeout, &block)
36
- rescue ::Timeout::Error
35
+ # TODO:
36
+ # think about the runtime error class-object creation that perevent any timeout error
37
+ # interception collisions (but remember: it can lead to regular internal ruby method/constant
38
+ # cache invalidation);
39
+ ::Timeout.timeout(timeout, RedisQueuedLocks::LockAcquiermentIntermediateTimeoutError, &block)
40
+ rescue RedisQueuedLocks::LockAcquiermentIntermediateTimeoutError
37
41
  on_timeout.call unless on_timeout == nil
38
42
 
39
43
  if raise_errors
@@ -13,6 +13,10 @@ module RedisQueuedLocks
13
13
  # @since 1.0.0
14
14
  LockAlreadyObtainedError = Class.new(Error)
15
15
 
16
+ # @api private
17
+ # @since 1.11.0
18
+ LockAcquiermentIntermediateTimeoutError = Class.new(::Timeout::Error)
19
+
16
20
  # @api public
17
21
  # @since 1.0.0
18
22
  LockAcquiermentTimeoutError = Class.new(Error)
@@ -5,6 +5,6 @@ module RedisQueuedLocks
5
5
  #
6
6
  # @api public
7
7
  # @since 0.0.1
8
- # @version 1.10.0
9
- VERSION = '1.10.0'
8
+ # @version 1.11.0
9
+ VERSION = '1.11.0'
10
10
  end
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'timeout'
3
4
  require 'redis-client'
4
5
  require 'qonfig'
5
- require 'timeout'
6
6
  require 'securerandom'
7
7
  require 'logger'
8
8
  require 'objspace'
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.10.0
4
+ version: 1.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rustam Ibragimov