whi-cassie 1.3.1 → 1.3.2

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: fb2b6308396ee1aa3b56d2bbf5e8aac4c7761454f37054049619154362bca277
4
- data.tar.gz: 884c1de5a55bc6a22d4a0acfebfea4c8fd1b6056c3794e69f06009eb4941992b
3
+ metadata.gz: 8c87e681cda4e500a2f9cb34eee05a806525cce81305f2732ff6b33bd9c13170
4
+ data.tar.gz: 4edfe67aa1bba47bac102cd3b1b181240bab73469e45d16c0a1cc922467c74e8
5
5
  SHA512:
6
- metadata.gz: 5594ac24a519edf94ae03a082a169c460344449c84028da950b0ddcdc521fd434b4601828df501132ef68bb1ec480aad2176312bea15ec4fd3daba34274d2e87
7
- data.tar.gz: 6dd17634a7c1879d0b94730aad7d083546dabb03135b1c77f830a76d3a451a9c5b84bd5842f44660752484b4110c1b6b5c9682f50bba04ef49b5ea83313f77a2
6
+ metadata.gz: 8b1e1b1e0f674740d0f217a608ae1f024fff3c2529b6a29028b46cb6cbbbc6a077c2dc0b4fb8e2c0b0fa5dd6fa6cc233df74c76ce302378a738583c2fa3ea6a6
7
+ data.tar.gz: e192c9f23cd323468b47dbc20762e63dc891c6837e6863eb56ea2abee7611d5b50289795dc9da5b6061c9b62495833df5c61599ff7feec15ca00a31a89dbee83
@@ -28,13 +28,13 @@ jobs:
28
28
  - name: standardrb
29
29
  if: matrix.job == 'standardrb'
30
30
  run: bundle exec rake standard
31
-
31
+
32
32
  specs:
33
33
  name: ${{ matrix.job }} ruby-${{ matrix.ruby }} ${{ matrix.activemodel && format('activemodel-{0}', matrix.activemodel) }} cassandra-${{ matrix.cassandra_version }}
34
34
  runs-on: ubuntu-latest
35
35
  services:
36
36
  cassandra:
37
- image: cassandra:${{ matrix.cassandra_version }}
37
+ image: cassandra:${{ matrix.cassandra_version || 'latest' }}
38
38
  ports:
39
39
  - 9042:9042
40
40
  strategy:
@@ -55,8 +55,10 @@ jobs:
55
55
  cassandra_version: "2"
56
56
  - ruby: "2.7"
57
57
  activemodel: "6"
58
+ job: rspec
58
59
  - ruby: "3.0"
59
60
  activemodel: "7"
61
+ job: rspec
60
62
  steps:
61
63
  - name: checkout
62
64
  uses: actions/checkout@v2
data/HISTORY.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.3.2
2
+
3
+ * Improved synchronization on reconnect logic.
4
+
1
5
  ## 1.3.1
2
6
 
3
7
  * Remove automatic reconnect on I/O errors.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.1
1
+ 1.3.2
data/lib/cassie.rb CHANGED
@@ -128,7 +128,9 @@ class Cassie
128
128
  # like passenger or unicorn you should call this method after forking.
129
129
  def reconnect
130
130
  disconnect
131
- connect
131
+ @monitor.synchronize do
132
+ connect unless connected?
133
+ end
132
134
  end
133
135
 
134
136
  # Prepare a CQL statement for repeate execution. Prepared statements
@@ -329,7 +331,13 @@ class Cassie
329
331
  end
330
332
 
331
333
  def session
332
- connect unless connected?
334
+ unless connected?
335
+ # Check again inside the monitor lock so we don't get in a race condition
336
+ # where another thread has already established the connection.
337
+ @monitor.synchronize do
338
+ connect unless connected?
339
+ end
340
+ end
333
341
  @session
334
342
  end
335
343
 
@@ -133,7 +133,7 @@ describe Cassie::Model do
133
133
  describe "batch" do
134
134
  it "should delegate to Cassie.batch using the write consistency" do
135
135
  expect(Cassie::Thing.connection).to be_a(Cassie)
136
- expect(Cassie::Thing.connection).to receive(:batch).with(consistency: :quorum).and_call_original
136
+ expect(Cassie::Thing.connection).to receive(:batch).and_call_original
137
137
  Cassie::Thing.batch {}
138
138
  end
139
139
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whi-cassie
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - We Heart It
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-05-07 00:00:00.000000000 Z
12
+ date: 2022-05-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cassandra-driver