message_bus 4.4.0 → 4.4.1

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: 357d1643581a819f8b51412902cf1e3c666d87f8971b1e56ae2d1d822a60c984
4
- data.tar.gz: 86fe067d70065dab59e4a8a739fd040d858af8b4e7658a4e4bcb36c79d41514a
3
+ metadata.gz: c4a55e419b6f5807f46429d27360a776c8c8057d663188f1911aca78cb6198fc
4
+ data.tar.gz: dd96e8f87e10aca16262ca540997011871f0ba809a1153eb330aa82d8683267d
5
5
  SHA512:
6
- metadata.gz: ef5368939b9c41b4a9faf41ac10f621a07d26d15760d6a5ab5dcc3eb6cc9f845923fc1400761fe2911fcb85f9eab8016778c20127228112618f67c0ccb77c238
7
- data.tar.gz: f2cfded03670efd4d8f3098002a4709781b4f59e98c6f19102f462f5965aa51cfd6a11b4dcacd4b82470305cd85d04a6ce623029e2c0dde2ad7cbad1ca8b3fc8
6
+ metadata.gz: b62eacf519bc544cde94ac05683938c2ca4c98bfaeaefd79e99ac012864d4c0ac20412ccc9fd0910cdf122b2883841af24339d299101b35e7296c0faa60c103f
7
+ data.tar.gz: 44fb3cda5e137b61f35d5b0f1be204ab179594df59423948946ad4790b5b9bf3d8087be3aa55f819dfe9df6b65d3a30138312cc69a0726711bd65821789f459c
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ 20-03-2025
2
+
3
+ - Version 4.4.1
4
+
5
+ - FIX: Handle Redis readonly errors for v4.x and v5.x.
6
+
1
7
  14-03-2025
2
8
 
3
9
  - Version 4.4.0
@@ -163,8 +163,8 @@ LUA
163
163
  redis_channel_name,
164
164
  ],
165
165
  )
166
- rescue ::Redis::CommandError => e
167
- if queue_in_memory && e.message =~ /READONLY/
166
+ rescue ::Redis::ReadOnlyError, ::Redis::CommandError => e
167
+ if queue_in_memory && readonly_exception?(e)
168
168
  @lock.synchronize do
169
169
  @in_memory_backlog << [channel, data]
170
170
  if @in_memory_backlog.length > @max_in_memory_publish_backlog
@@ -402,8 +402,8 @@ LUA
402
402
  begin
403
403
  # TODO recover special options
404
404
  publish(*@in_memory_backlog[0], queue_in_memory: false)
405
- rescue ::Redis::CommandError => e
406
- if e.message =~ /^READONLY/
405
+ rescue ::Redis::ReadOnlyError, ::Redis::CommandError => e
406
+ if readonly_exception?(e)
407
407
  try_again = true
408
408
  else
409
409
  @logger.warn(
@@ -445,11 +445,15 @@ LUA
445
445
  pub_redis.disconnect!
446
446
  pub_redis.set(key, "1")
447
447
  false
448
- rescue ::Redis::CommandError => e
449
- true if e.message =~ /^READONLY/
448
+ rescue ::Redis::ReadOnlyError, ::Redis::CommandError => e
449
+ true if readonly_exception?(e)
450
450
  end
451
451
  end
452
452
 
453
+ def readonly_exception?(exception)
454
+ exception.is_a?(::Redis::ReadOnlyError) || (exception.is_a?(::Redis::CommandError) && exception.message =~ /^READONLY/)
455
+ end
456
+
453
457
  MessageBus::BACKENDS[:redis] = self
454
458
  end
455
459
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MessageBus
4
- VERSION = "4.4.0"
4
+ VERSION = "4.4.1"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: message_bus
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.0
4
+ version: 4.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-03-14 00:00:00.000000000 Z
10
+ date: 2025-03-20 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rack