clickhouse-native 0.5.0-aarch64-linux-gnu → 0.7.0-aarch64-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: aca1fe60826ebd4ce6195574e7f54d42149441dfad431a71edc5418844ee69fd
4
- data.tar.gz: b6dd6f2324bf040366dfef102e642b3b2d8426aff1cb4046375c54f5f54bdb4f
3
+ metadata.gz: 36b4983fdf477c8450778f09e2b0470966267587ce9b1b80b16eb7ea7e9cee53
4
+ data.tar.gz: d076a6896a96511376c7a0721dbfd7fd06ac2d235fc36efa39a5bca55effa41e
5
5
  SHA512:
6
- metadata.gz: 83c3730225c9f95e6a48c2e84780024d2fe18ef85d84ae7e935bc6b3b0488f30d8bae9034fda77c1de9e855570980131a526fe375dbde64b5f219a2ca87fb995
7
- data.tar.gz: e5eeb85c767f9d29239d8bb6cac7051fa87d8f38f2f5fbd7d0a7ad9c2a98fceb03a8199c9f3632ea1b4edcdd4c5700d0170817d9e50f5da303a4a998d2ae4aa1
6
+ metadata.gz: 3d8a3d88089a58c4295be2a8565def7cd2586a19bcda7b40b28d128483bed3b15d1863d1b4255f8b00676da6a3ec5ad7d1103577c24b02c3f7675361109e968e
7
+ data.tar.gz: 7370beaa8d36fd238bb22574f678ed2d1de2c29bb928b2567250314734eb76c928e6c2252e8454669b2910830acc571568cb612a42e0b1d720addda4289110ad
@@ -4,8 +4,6 @@ require "connection_pool"
4
4
 
5
5
  module ClickhouseNative
6
6
  class Pool
7
- STALE_IVAR = :@clickhouse_native_settings_stale
8
-
9
7
  attr_reader :host, :port, :database
10
8
 
11
9
  def initialize(host:, port:, database: "default", user: "default", password: "",
@@ -23,19 +21,20 @@ module ClickhouseNative
23
21
  end
24
22
  end
25
23
 
26
- # Yields a client with the pool's session settings applied. If the
27
- # previous checkout raised (which, in this gem's C++ bindings, always
28
- # triggers a ResetConnection that wipes the session), re-apply the SET
29
- # before yielding. Exceptions re-raise after marking the client stale.
24
+ # On exception, discard the client rather than reuse it: an error
25
+ # path leaves the socket in an unknown state. The C++ binding issues
26
+ # ResetConnection, but a subsequent send can still surface buffered
27
+ # protocol errors from the prior aborted operation those get
28
+ # attributed to whatever SQL we tried next (e.g. the SET reapplying
29
+ # session settings), producing misleading log lines and re-raises in
30
+ # unrelated code. A fresh socket + handshake is cheap relative to
31
+ # debugging that.
30
32
  def with
31
33
  @pool.with do |client|
32
- reapply_settings_if_stale(client)
33
- begin
34
- yield client
35
- rescue
36
- client.instance_variable_set(STALE_IVAR, true)
37
- raise
38
- end
34
+ yield client
35
+ rescue
36
+ @pool.discard_current_connection(&:close)
37
+ raise
39
38
  end
40
39
  end
41
40
 
@@ -73,13 +72,6 @@ module ClickhouseNative
73
72
 
74
73
  private
75
74
 
76
- def reapply_settings_if_stale(client)
77
- return unless @set_sql
78
- return unless client.instance_variable_get(STALE_IVAR)
79
- client.execute(@set_sql)
80
- client.instance_variable_set(STALE_IVAR, false)
81
- end
82
-
83
75
  # Render a `SET key1 = val1, key2 = val2` statement once at pool setup
84
76
  # so every checked-out connection starts with the same session
85
77
  # settings. Matches how the HTTP driver injected global_params per
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ClickhouseNative
4
- VERSION = "0.5.0"
4
+ VERSION = "0.7.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.5.0
4
+ version: 0.7.0
5
5
  platform: aarch64-linux-gnu
6
6
  authors:
7
7
  - Yuri Smirnov
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: '2.4'
18
+ version: 2.5.4
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: '2.4'
25
+ version: 2.5.4
26
26
  description: A high-performance Ruby client for ClickHouse using the native binary
27
27
  protocol via a C++ extension wrapping clickhouse-cpp.
28
28
  email: