rails_failover 0.5.5 → 0.5.6

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: f9e7962a5fcbef661687ae3b9ae69cfcbd3af9b9a0f8cc8d7be7b011134f29d1
4
- data.tar.gz: 9dd1ace7810ee483e5cb304c03578219916d04b997349bba67745becac4a5133
3
+ metadata.gz: c3a3ec0058f66ac60c355117284cc6c3ef9edbde71d74d966e38c2e10d38b828
4
+ data.tar.gz: dbfbe03fe13a70ecbc32729ce47223e41b4d9c53d6baeb42df296391490b6116
5
5
  SHA512:
6
- metadata.gz: d30f6d6bc51b0c5c889de5f433c88a039ed66c1d26720210f78c0111ef34aeb8e9fcde3bfd2f99e45c50ac60060245d804045afd4d0ffd6be3ad1de3f9fcabfa
7
- data.tar.gz: 4f50a94b04574486bcb3934957d29e9986c1b9e93b74a3834d5a4835ec970c8764c5a1237a4f02f0897dc7b71b0ca5e8930e1c829c66540770bda750c9faff6f
6
+ metadata.gz: 7283bd61a7804eb4b5e501e03b71343c620e84f3b334665783a99d8c19fb135d5f49bb97d2f537938d4e73427086c7815981eb4c684b7ed3a38befd878014753
7
+ data.tar.gz: 3856f52865af591c157d29b0613382dd54a4614cc943313f373077db4ab950beaaba953f696faf7298304c283123e0b40ff48d29ea4d8672025ff7d49e778b1f
@@ -6,6 +6,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.5.6] - 2020-09-14
10
+
11
+ - FIX: Iteration and mutation of primaries_down in separate threads (#5)
12
+
13
+ Ruby hashes can't be modified whilst they are being iterated over.
14
+
15
+ Here, the primaries_down hash is iterated over to check each previously
16
+ unavailable primary to see if it is now contactable. However, since this
17
+ hash can be updated in other threads, this iteration isn't safe.
18
+
19
+ To prevent this, a copy of the hash is iterated over instead.
20
+
21
+ The GIL should not be released during a hash dup [1], but let's not tie
22
+ ourselves unnecessarily to current MRI behaviour.
23
+
24
+ [1]: https://github.com/ruby-concurrency/concurrent-ruby/issues/528
25
+
26
+
9
27
  ## [0.5.5] - 2020-08-04
10
28
 
11
29
  - 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.5)
4
+ rails_failover (0.5.6)
5
5
  activerecord (~> 6.0)
6
6
  railties (~> 6.0)
7
7
 
@@ -41,7 +41,7 @@ GEM
41
41
  erubi (1.9.0)
42
42
  i18n (1.8.2)
43
43
  concurrent-ruby (~> 1.0)
44
- loofah (2.6.0)
44
+ loofah (2.7.0)
45
45
  crass (~> 1.0.2)
46
46
  nokogiri (>= 1.5.9)
47
47
  method_source (1.0.0)
@@ -63,7 +63,7 @@ module RailsFailover
63
63
 
64
64
  active_primaries_keys = {}
65
65
 
66
- primaries_down.each do |key, options|
66
+ mon_synchronize { primaries_down.dup }.each do |key, options|
67
67
  info = nil
68
68
  options = options.dup
69
69
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsFailover
4
- VERSION = "0.5.5"
4
+ VERSION = "0.5.6"
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.5
4
+ version: 0.5.6
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-08-04 00:00:00.000000000 Z
11
+ date: 2020-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord