kasket 4.9.0 → 4.9.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: e1399453146b7dcf0974eb42a7b80375291b2978415269d686ff66ccb77b9f53
4
- data.tar.gz: 4649d5f06595e558f859472439733208e62229841901bf9dc81b602c3f78e07e
3
+ metadata.gz: 75e9005963ca629245005b0c9a2a9d94cb9023fac9cc12327045e25eaca547e0
4
+ data.tar.gz: e7aec95609b6918646f3b2b420d5af038ef171888ac98cdea4c0fb16cf6ce086
5
5
  SHA512:
6
- metadata.gz: 7a6eeea3f1cdfe9bb349379cb07f4d13a21bfa0867ed09e9795746d91f74a69349ee15eb83d76e6f4776a717d8d4f2b8ce1479d41a095ac2e275502e3b54c99c
7
- data.tar.gz: fd34ac51846f1748a47cf0de7b2c5f27ef843abe93429285e3830a8a8c3afb53822f7eab19452af3df5c99483323e1c0d9fd2a727ddda535626e58408a5a28e1
6
+ metadata.gz: f19bd6ca3a60073c738907e20052d461cdcc0139a1c300765ed3b029022107d7c477b6a5e6437bb34d73de5d8e2c6050eac3e6834ec6c7f27c3e7e1e5a0fa200
7
+ data.tar.gz: effe82d0f1620cc7742407a46054b558675ac061050af22313daccdc52dc30204c5ae02c67f91aeea64ce07f4c687d2a6eb699c132a0914284d2554cec0d014b
@@ -64,11 +64,23 @@ module Kasket
64
64
  end
65
65
 
66
66
  def find_by_sql_with_kasket_on_id_array(keys)
67
- key_attributes_map = Kasket.cache.read_multi(*keys)
68
-
69
- found_keys, missing_keys = keys.partition {|k| key_attributes_map[k] }
70
- found_keys.each {|k| key_attributes_map[k] = instantiate(key_attributes_map[k].dup) }
71
- key_attributes_map.merge!(missing_records_from_db(missing_keys))
67
+ begin
68
+ key_attributes_map = Kasket.cache.read_multi(*keys)
69
+ rescue RuntimeError => e
70
+ # Elasticache Memcached has a bug where it returns a 0x00 binary protocol response with no data
71
+ # during a reboot, causing the Dalli memcached client to throw a RuntimeError during a multi get
72
+ # (https://github.com/petergoldstein/dalli/blob/v2.7.7/lib/dalli/server.rb#L148).
73
+ # Fall back to the database when this happens.
74
+ if e.message == "multi_response has completed"
75
+ key_attributes_map = missing_records_from_db(keys)
76
+ else
77
+ raise
78
+ end
79
+ else
80
+ found_keys, missing_keys = keys.partition {|k| key_attributes_map[k] }
81
+ found_keys.each {|k| key_attributes_map[k] = instantiate(key_attributes_map[k].dup) }
82
+ key_attributes_map.merge!(missing_records_from_db(missing_keys))
83
+ end
72
84
 
73
85
  key_attributes_map.values.compact
74
86
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module Kasket
3
- VERSION = '4.9.0'
3
+ VERSION = '4.9.1'
4
4
  class Version
5
5
  MAJOR = Kasket::VERSION.split('.')[0]
6
6
  MINOR = Kasket::VERSION.split('.')[1]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kasket
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.9.0
4
+ version: 4.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mick Staugaard
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-07-19 00:00:00.000000000 Z
12
+ date: 2021-08-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -180,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
180
  - !ruby/object:Gem::Version
181
181
  version: '0'
182
182
  requirements: []
183
- rubygems_version: 3.2.22
183
+ rubygems_version: 3.1.6
184
184
  signing_key:
185
185
  specification_version: 4
186
186
  summary: A write back caching layer on active record