rails_failover 0.5.6 → 0.5.7

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: c3a3ec0058f66ac60c355117284cc6c3ef9edbde71d74d966e38c2e10d38b828
4
- data.tar.gz: dbfbe03fe13a70ecbc32729ce47223e41b4d9c53d6baeb42df296391490b6116
3
+ metadata.gz: 6711544c6ae90ab17b509fc3cb97e7b5cc4fd5579daee706dfcc9abb03141a22
4
+ data.tar.gz: 4bea899af7859b72f88a5e9bd185f72fbca2b968b4a8ed0d73dbc6e41be5acce
5
5
  SHA512:
6
- metadata.gz: 7283bd61a7804eb4b5e501e03b71343c620e84f3b334665783a99d8c19fb135d5f49bb97d2f537938d4e73427086c7815981eb4c684b7ed3a38befd878014753
7
- data.tar.gz: 3856f52865af591c157d29b0613382dd54a4614cc943313f373077db4ab950beaaba953f696faf7298304c283123e0b40ff48d29ea4d8672025ff7d49e778b1f
6
+ metadata.gz: 9d58e8aeec4c77b22e8a44d80667b8af553b10323d826fa16da493ab71326e3f0fb4c8f8b4f00fa89f2e53a357642b6c84d138590561c2d389a03de83cac8510
7
+ data.tar.gz: a6de657f916e8ced227f21c06ab36f168ca8c17adfde474e80526d9a1ab145ab2b00500c93775b22bd6efa35e604fb0c8f9d9b91256caf567a80cb9599c9e270
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.5.7] - 2020-09-16
10
+
11
+ - FIX: Avoid disconnecting Redis connections abruptly.
12
+
9
13
  ## [0.5.6] - 2020-09-14
10
14
 
11
15
  - FIX: Iteration and mutation of primaries_down in separate threads (#5)
@@ -23,7 +27,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
23
27
 
24
28
  [1]: https://github.com/ruby-concurrency/concurrent-ruby/issues/528
25
29
 
26
-
27
30
  ## [0.5.5] - 2020-08-04
28
31
 
29
32
  - FIX: Rescue from `Redis::TimeoutError` instead of `Timeout::Error`.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rails_failover (0.5.6)
4
+ rails_failover (0.5.7)
5
5
  activerecord (~> 6.0)
6
6
  railties (~> 6.0)
7
7
 
@@ -177,9 +177,16 @@ module RailsFailover
177
177
  key = options[:id]
178
178
 
179
179
  mon_synchronize do
180
- if clients[key]
181
- clients[key].dup.each do |c|
182
- c.disconnect
180
+ if to_disconnect = clients[key].dup
181
+ # Don't disconnect connections abruptly since it may lead to unexepcted
182
+ # errors. Is there a better way to do this without having to monkey patch
183
+ # the redis-rb gem heavily?
184
+ ObjectSpace.each_object(::Redis).each do |redis|
185
+ to_disconnect.each do |c|
186
+ if redis._client == c
187
+ redis.synchronize { |_client| _client.disconnect }
188
+ end
189
+ end
183
190
  end
184
191
  end
185
192
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsFailover
4
- VERSION = "0.5.6"
4
+ VERSION = "0.5.7"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_failover
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alan Tan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-14 00:00:00.000000000 Z
11
+ date: 2020-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord