pgmq-ruby 0.7.0 → 0.7.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: ee008476f444de984ef7413b21bee87043d9e5e87a7eabf85a934cf74b147225
4
- data.tar.gz: 1dd10b9b77c9dc4109f6a8e779c970fc6f7ee2e4880cecb467ab3060ecc4f571
3
+ metadata.gz: 3b279a0ca02d6b0970b00c829df9201f746bc112157d9b782308bbdf2238daae
4
+ data.tar.gz: b3d46c1e884ff4e362a15c3384f8b0cc1515f16fdc1806606376fbd855011087
5
5
  SHA512:
6
- metadata.gz: 32cc154c5df5d6501de5bf93daf32857448645b9fe5071bec84b51dbda86cf0efd1fe6cddfd24707fda8201e7d6b8fb10c02f3c7e2bf108226b50a4cbe1b65fd
7
- data.tar.gz: ad2630d6736bc49490ccb2eec83da4878dd4b349e9e06cd12f5d9f62a10109922a379c0dab43aa5a0c8a3f33241ca71f6c6ba24386cc6a7cf097db1397ef2518
6
+ metadata.gz: 9c8b865a9296430fe93b3ab7e7a8fb89857370cd29c8288cd61f8ccc5ddf4ef7a192070e1479079dd8920361997911595c6b2fc7b3239b0d69aee161680c272e
7
+ data.tar.gz: 92ac6cf951476851bb442d10497317f53496594fd4da05171b0fab0f2e9191a6e5d0251cd5154025501dbac1b802175050b5d9eb712e4dac8f3b9f7ba839a305
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.1 (2026-07-09)
4
+
5
+ ### Connection Pool
6
+ - **[Feature]** Add `PGMQ::Connection#reload` (and `PGMQ::Client#reload`, which delegates to it). It drops every
7
+ connection currently in the pool and lets the pool rebuild fresh ones lazily on the next checkout — unlike `#close`,
8
+ which shuts the pool down permanently. Use it to recover from a connection that libpq still reports as
9
+ `CONNECTION_OK` but is in fact wedged, e.g. after a wall-clock `Timeout.timeout` interrupted a query mid-flight and
10
+ left the socket poisoned so it re-hangs on reuse. `#verify_connection!` cannot catch that case (the connection does
11
+ not report `CONNECTION_BAD`), so the caller must discard it explicitly; `reload` is the safe, pool-wide way to do so.
12
+ Connections it drops are closed. Implemented via `ConnectionPool#reload`.
13
+
3
14
  ## 0.7.0 (2026-06-15)
4
15
 
5
16
  ### Queue Naming
data/lib/pgmq/client.rb CHANGED
@@ -84,6 +84,17 @@ module PGMQ
84
84
  @connection.close
85
85
  end
86
86
 
87
+ # Drops every pooled connection and rebuilds lazily on the next checkout,
88
+ # leaving the pool usable (unlike {#close}). Use it to discard a connection
89
+ # that reports +CONNECTION_OK+ but is actually wedged — e.g. after a
90
+ # wall-clock timeout interrupted a query mid-flight and left the socket
91
+ # poisoned so it would re-hang on reuse. See {PGMQ::Connection#reload}.
92
+ #
93
+ # @return [void]
94
+ def reload
95
+ @connection.reload
96
+ end
97
+
87
98
  # Returns connection pool statistics
88
99
  #
89
100
  # @return [Hash] statistics about the connection pool
@@ -178,6 +178,29 @@ module PGMQ
178
178
  @pool.shutdown { |conn| conn.close unless conn.finished? }
179
179
  end
180
180
 
181
+ # Drops every connection currently in the pool and lets the pool build fresh
182
+ # ones lazily on the next checkout. Unlike {#close} (which shuts the pool
183
+ # down permanently), the pool stays usable afterwards.
184
+ #
185
+ # Use this to recover from a connection that libpq still reports as
186
+ # +CONNECTION_OK+ but which is in fact wedged — e.g. after a wall-clock
187
+ # timeout (+Timeout.timeout+) interrupted a query mid-flight, leaving the
188
+ # socket poisoned so it re-hangs on reuse. {#verify_connection!} cannot catch
189
+ # that case (the connection does not report +CONNECTION_BAD+), so the caller
190
+ # must discard it explicitly; +reload+ is the safe, pool-wide way to do so.
191
+ #
192
+ # @return [void]
193
+ # @example Discard the pool after a query had to be force-interrupted
194
+ # begin
195
+ # Timeout.timeout(5) { connection.with_connection { |conn| conn.exec("SELECT ...") } }
196
+ # rescue Timeout::Error
197
+ # connection.reload # drop the possibly-poisoned pooled connections
198
+ # raise
199
+ # end
200
+ def reload
201
+ @pool.reload { |conn| conn.close unless conn.finished? }
202
+ end
203
+
181
204
  # Returns connection pool statistics
182
205
  #
183
206
  # @return [Hash] statistics about the connection pool
data/lib/pgmq/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module PGMQ
4
4
  # Current version of the pgmq-ruby gem
5
- VERSION = "0.7.0"
5
+ VERSION = "0.7.1"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pgmq-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld