redis-client 0.26.2 → 0.26.3

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: f75c9f8b8e4542079642b30d284bd0fbda23d27249e7846bc65c0b002ce61732
4
- data.tar.gz: cdc1d818e27551467b14e53692b5e61da762d1f21de78be00d6650830fdb9d13
3
+ metadata.gz: f1158a824b42ce5297ff9eb38755a9af61ccc3635f6f201e17708e91ffc8b230
4
+ data.tar.gz: 8c8ffd7afa1672760e628ae6725f02b614588a963288dd55cb8fc2b5db43ed82
5
5
  SHA512:
6
- metadata.gz: 15d23f1645fc7bc86c3f58ff0bfebcce62a3aec4783fd5434123277c0445a8d7553fea6f7fc89a36c23c433d7fcd5716b88a79d5131d3a3452d58707e61b965d
7
- data.tar.gz: 7447f4f33e056072445d5d0dad650f3e648af69f1a0690505cb6913d525c32b29f5954349e0ca4852b3bd8d47434ada0e8e1ffde09f8966a664cff08acc5a443
6
+ metadata.gz: 2ba91ae532685d186151cc2a2b3b9d2cc485968a4b4aafb765fae2bce0046d962776dd5dd9ba783c9baae7425d785af9600d28b22befaf982ea90689ec373242
7
+ data.tar.gz: 373343251df2027cb19ab4fab1cdc63de4b5d2f2ca5bcc2542e9486818bbc93b6b88da63d34a1db63044f4adba690b4d2f534390acb8c2739a633c9b6bfcda42
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Unreleased
2
2
 
3
+ # 0.26.3
4
+
5
+ - Fix `rediss://` (ssl) URLs used with Redis sentinel.
6
+ - Handle Ruby 4.0 connection timeout raising an `IO::Timeout` instead of `Errno::ETIMEDOUT`.
7
+ - Entirely close the connection on authentication failures.
8
+
3
9
  # 0.26.2
4
10
 
5
11
  - Fix compatibility with `connection_pool` version 3+.
@@ -156,7 +156,7 @@ class RedisClient
156
156
  write_timeout: @write_timeout,
157
157
  )
158
158
  true
159
- rescue SystemCallError, OpenSSL::SSL::SSLError, SocketError => error
159
+ rescue SystemCallError, IOError, OpenSSL::SSL::SSLError, SocketError => error
160
160
  socket&.close
161
161
  raise CannotConnectError, error.message, error.backtrace
162
162
  end
@@ -28,6 +28,7 @@ class RedisClient
28
28
  username: url_config.username,
29
29
  password: url_config.password,
30
30
  db: url_config.db,
31
+ ssl: url_config.ssl?,
31
32
  }.compact.merge(client_config)
32
33
  name ||= url_config.host
33
34
  end
@@ -66,6 +67,8 @@ class RedisClient
66
67
 
67
68
  client_config[:reconnect_attempts] ||= DEFAULT_RECONNECT_ATTEMPTS
68
69
  @client_config = client_config || {}
70
+ @sentinel_client_config = @client_config.dup
71
+ @sentinel_client_config.delete(:ssl)
69
72
  super(**client_config)
70
73
  @sentinel_configs = sentinels_to_configs(sentinels)
71
74
  end
@@ -133,9 +136,9 @@ class RedisClient
133
136
  sentinels.map do |sentinel|
134
137
  case sentinel
135
138
  when String
136
- Config.new(**@client_config, **@extra_config, url: sentinel)
139
+ Config.new(**@sentinel_client_config, **@extra_config, url: sentinel)
137
140
  else
138
- Config.new(**@client_config, **@extra_config, **sentinel)
141
+ Config.new(**@sentinel_client_config, **@extra_config, **sentinel)
139
142
  end
140
143
  end
141
144
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class RedisClient
4
- VERSION = "0.26.2"
4
+ VERSION = "0.26.3"
5
5
  end
data/lib/redis_client.rb CHANGED
@@ -843,13 +843,16 @@ class RedisClient
843
843
  end
844
844
  end
845
845
  rescue FailoverError, CannotConnectError => error
846
+ @raw_connection&.close
846
847
  error._set_config(config)
847
848
  raise error
848
849
  rescue ConnectionError => error
850
+ @raw_connection&.close
849
851
  connect_error = CannotConnectError.with_config(error.message, config)
850
852
  connect_error.set_backtrace(error.backtrace)
851
853
  raise connect_error
852
854
  rescue CommandError => error
855
+ @raw_connection&.close
853
856
  if error.message.match?(/ERR unknown command ['`]HELLO['`]/)
854
857
  raise UnsupportedServer,
855
858
  "redis-client requires Redis 6+ with HELLO command available (#{config.server_url})"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.2
4
+ version: 0.26.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier
@@ -70,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
70
70
  - !ruby/object:Gem::Version
71
71
  version: '0'
72
72
  requirements: []
73
- rubygems_version: 3.6.9
73
+ rubygems_version: 4.0.3
74
74
  specification_version: 4
75
75
  summary: Simple low-level client for Redis 6+
76
76
  test_files: []