clickhouse-native 0.6.0-x86_64-linux-gnu → 0.8.0-x86_64-linux-gnu

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: 469242b033961b2e0199057f1ea739c45ade11615c74ec74b989541dd847015d
4
- data.tar.gz: 91ad8fc6a5a3ce4ff03ade336b312bd311d3ca93d6c9764cfe80445a3402df9b
3
+ metadata.gz: a7cdb9007764046cf786f709b0999fdbe0af1e63bd45e515d245419b59c77486
4
+ data.tar.gz: 15ddc422f1bd7f62077813bd621396df59fe09ac7b25c0c48b7761b206aeb9ff
5
5
  SHA512:
6
- metadata.gz: d9d683ad735e44d66b1889c891ddf34d8a6716f5f6e0fd9c7e5c56f71855b23ba0f7b06933f6467e7482fddfd842829a807fc42199c4a2059a6ea2c523024b0a
7
- data.tar.gz: b9873623a62d30e0c0f45eb3291cec0e8a61ec5c71898b01499f75512ae0c277f4e31c454a8f127f27d213c171f9ab7a5d91dcff5709918db9cc1ae86b2f4115
6
+ metadata.gz: d4af0c2023f265a32a48b7da931341c9c0c34ca96cdf1fb78338065f8e93de21018868bf7f53a3d9e73bf805ab86ce865d5bc8d6ec82e5c89508072ed3b0fe80
7
+ data.tar.gz: fe620fad3f41303934821e0d88904ae32bc3d53280d42dc65043fda36a60fd7ee31975e13684d4813ebd9f98a1abe9ea89c39f7720e06fe0ae3091c7ddb3e81f
@@ -29,11 +29,26 @@ module ClickhouseNative
29
29
  # session settings), producing misleading log lines and re-raises in
30
30
  # unrelated code. A fresh socket + handshake is cheap relative to
31
31
  # debugging that.
32
+ #
33
+ # ConnectionError gets one automatic retry: pooled connections that
34
+ # have been idle long enough for the server / an LB to FIN them
35
+ # surface as "closed" on the very next recv (errno 0, message
36
+ # "closed: Success"). Discarding and re-checking out lands a fresh
37
+ # socket and the operation succeeds. The retry only triggers when
38
+ # the dead-connection error fired before any data was sent, so
39
+ # write operations don't risk double-execution from this path.
32
40
  def with
33
- @pool.with do |client|
34
- yield client
35
- rescue
36
- @pool.discard_current_connection(&:close)
41
+ attempts = 0
42
+ begin
43
+ @pool.with do |client|
44
+ yield client
45
+ rescue
46
+ @pool.discard_current_connection(&:close)
47
+ raise
48
+ end
49
+ rescue ConnectionError
50
+ attempts += 1
51
+ retry if attempts == 1
37
52
  raise
38
53
  end
39
54
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ClickhouseNative
4
- VERSION = "0.6.0"
4
+ VERSION = "0.8.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clickhouse-native
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.8.0
5
5
  platform: x86_64-linux-gnu
6
6
  authors:
7
7
  - Yuri Smirnov