redis-cluster-client 0.11.4 → 0.11.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f72e0ed5a40d8d663d00a29ffb43ec046d911c73e514fa709f907eaf59d2e751
4
- data.tar.gz: 442e3c7ef0e59dbef1950eb661aaf4441226927d4c871ae9a81824b33c456c4e
3
+ metadata.gz: 175bb2bf9b82d2b1d0b95e8d7e3e74e3952165f2edea957303f8b16716a17273
4
+ data.tar.gz: 1e094b0d0ae859cb4d77cc872203c21f2f408b739a748d518fd60ca7c33e7451
5
5
  SHA512:
6
- metadata.gz: 3c06f2218983448bba3daef5209828aec9b236757094a9635e514519adf0757385f91c8c7d9a62a86d6eb9bf652e9b354a71c457a60208793c63ebd43c14c3d0
7
- data.tar.gz: 523b7c8b897329260cacf1ab03ba26f917aa8dea0a78682d3aeeb8da538bed87ee482ed4f8e8db6e8f1d63649447b664cd86360f0a7e8bb554f4457d451c0946
6
+ metadata.gz: 8b8a13a4df4b5d96da3bcb618bada62d5882fb688b7fd7a9d618c6733a44913af24222c48d40f4db0a316d58b00aa608de99467114dac22711eb7b421f7e2e8a
7
+ data.tar.gz: 2c3ebd371f3a23388e6600192a6403c5f97a90f7a7c06bab747310fa729d8be8f9d7d793763a8e7829f2e4699893d76964a96bd0ea40e727d0bdb499e1ef9f67
@@ -309,7 +309,7 @@ class RedisClient
309
309
  work_group.push(i, raw_client) do |client|
310
310
  regular_timeout = client.read_timeout
311
311
  client.read_timeout = @config.slow_command_timeout > 0.0 ? @config.slow_command_timeout : regular_timeout
312
- reply = client.call('CLUSTER', 'NODES')
312
+ reply = client.call_once('CLUSTER', 'NODES')
313
313
  client.read_timeout = regular_timeout
314
314
  parse_cluster_node_reply(reply)
315
315
  rescue StandardError => e
@@ -35,11 +35,15 @@ class RedisClient
35
35
  # Ruby VM allocates 1 MB memory as a stack for a thread.
36
36
  # It is a fixed size but we can modify the size with some environment variables.
37
37
  # So it consumes memory 1 MB multiplied a number of workers.
38
- Thread.new(client, queue) do |pubsub, q|
38
+ Thread.new(client, queue, nil) do |pubsub, q, prev_err|
39
39
  loop do
40
40
  q << pubsub.next_event
41
+ prev_err = nil
41
42
  rescue StandardError => e
43
+ next sleep 0.005 if e.instance_of?(prev_err.class) && e.message == prev_err&.message
44
+
42
45
  q << e
46
+ prev_err = e
43
47
  end
44
48
  end
45
49
  end
@@ -160,7 +164,6 @@ class RedisClient
160
164
  @router.renew_cluster_state
161
165
  @state_dict.each_value(&:close)
162
166
  @state_dict.clear
163
- @queue.clear
164
167
  @commands.each { |command| _call(command) }
165
168
  break
166
169
  rescue ::RedisClient::ConnectionError, ::RedisClient::Cluster::NodeMightBeDown
@@ -15,10 +15,10 @@ class RedisClient
15
15
 
16
16
  attr_reader :config
17
17
 
18
- def initialize(config, pool: nil, concurrency: nil, **kwargs)
19
- @config = config
18
+ def initialize(config = nil, pool: nil, concurrency: nil, **kwargs)
19
+ @config = config.nil? ? ClusterConfig.new(**kwargs) : config
20
20
  @concurrent_worker = ::RedisClient::Cluster::ConcurrentWorker.create(**(concurrency || {}))
21
- @command_builder = config.command_builder
21
+ @command_builder = @config.command_builder
22
22
 
23
23
  @pool = pool
24
24
  @kwargs = kwargs
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-cluster-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.4
4
+ version: 0.11.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taishi Kasuga
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-27 00:00:00.000000000 Z
11
+ date: 2024-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis-client