pgb_connection_reaper_rb 0.2.1 → 0.2.2
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 +4 -4
- data/.github/workflows/ci.yml +34 -0
- data/.github/workflows/release.yml +26 -1
- data/Gemfile.lock +38 -31
- data/lib/pgb_connection_reaper_rb/postgresql_adapter_extension.rb +11 -11
- data/lib/pgb_connection_reaper_rb/version.rb +1 -1
- data/pgb_connection_reaper_rb.gemspec +3 -3
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df4188fc6c40fca8a527004d05f2af6e9643e8cea1ab87e609ff8e8b30e95faa
|
4
|
+
data.tar.gz: 468bd15baffee28aa71d5881733892877388922151ae4e40863e5d8116cea451
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abf64c4573c1b21563b0913bbb67f8c994e5f7d34f29481f77184662224bae66f79404071cd61563c34359afde35738071b5c0879613fadcbd9d8b2cc877213a
|
7
|
+
data.tar.gz: 75d765f2cf9d9436ada42ee4f29b4f10a8aacc1b30f9640330dbbf9e3f0e08a07c5b407329b087411a25e95e81c89f2398705db41daafe48c41f40f8ce752202
|
@@ -0,0 +1,34 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ main ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ main ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
|
13
|
+
strategy:
|
14
|
+
fail-fast: false
|
15
|
+
matrix:
|
16
|
+
ruby: ['3.1', '3.2', '3.3']
|
17
|
+
|
18
|
+
name: Ruby ${{ matrix.ruby }}
|
19
|
+
|
20
|
+
steps:
|
21
|
+
- uses: actions/checkout@v4
|
22
|
+
|
23
|
+
- name: Set up Ruby
|
24
|
+
uses: ruby/setup-ruby@v1
|
25
|
+
with:
|
26
|
+
ruby-version: ${{ matrix.ruby }}
|
27
|
+
bundler: '2.5.11'
|
28
|
+
bundler-cache: true
|
29
|
+
|
30
|
+
- name: Install Appraisal dependencies
|
31
|
+
run: bundle exec appraisal install
|
32
|
+
|
33
|
+
- name: Run tests against all ActiveRecord versions
|
34
|
+
run: bundle exec appraisal rspec
|
@@ -2,18 +2,43 @@ name: Release
|
|
2
2
|
|
3
3
|
on:
|
4
4
|
workflow_dispatch:
|
5
|
+
|
5
6
|
jobs:
|
7
|
+
test:
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
|
10
|
+
steps:
|
11
|
+
- uses: actions/checkout@v4
|
12
|
+
|
13
|
+
- name: Set up Ruby
|
14
|
+
uses: ruby/setup-ruby@v1
|
15
|
+
with:
|
16
|
+
ruby-version: 3.3
|
17
|
+
bundler: '2.5.11'
|
18
|
+
bundler-cache: true
|
19
|
+
|
20
|
+
- name: Install Appraisal dependencies
|
21
|
+
run: bundle exec appraisal install
|
22
|
+
|
23
|
+
- name: Run tests
|
24
|
+
run: bundle exec appraisal rspec
|
25
|
+
|
6
26
|
release:
|
27
|
+
needs: test
|
7
28
|
permissions:
|
8
29
|
contents: write
|
9
30
|
id-token: write
|
10
31
|
|
11
32
|
name: Release
|
12
33
|
runs-on: ubuntu-latest
|
34
|
+
|
13
35
|
steps:
|
14
36
|
- uses: actions/checkout@v4
|
37
|
+
|
15
38
|
- uses: ruby/setup-ruby@v1
|
16
39
|
with:
|
17
40
|
ruby-version: 3.3
|
41
|
+
bundler: '2.5.11'
|
18
42
|
bundler-cache: true
|
19
|
-
|
43
|
+
|
44
|
+
- uses: rubygems/release-gem@v1
|
data/Gemfile.lock
CHANGED
@@ -1,73 +1,80 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
pgb_connection_reaper_rb (0.2.
|
5
|
-
activerecord (>=
|
6
|
-
activesupport (>=
|
4
|
+
pgb_connection_reaper_rb (0.2.2)
|
5
|
+
activerecord (>= 6.1)
|
6
|
+
activesupport (>= 6.1)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activemodel (7.
|
12
|
-
activesupport (= 7.
|
13
|
-
activerecord (7.
|
14
|
-
activemodel (= 7.
|
15
|
-
activesupport (= 7.
|
11
|
+
activemodel (7.2.2.2)
|
12
|
+
activesupport (= 7.2.2.2)
|
13
|
+
activerecord (7.2.2.2)
|
14
|
+
activemodel (= 7.2.2.2)
|
15
|
+
activesupport (= 7.2.2.2)
|
16
16
|
timeout (>= 0.4.0)
|
17
|
-
activesupport (7.
|
17
|
+
activesupport (7.2.2.2)
|
18
18
|
base64
|
19
19
|
benchmark (>= 0.3)
|
20
20
|
bigdecimal
|
21
|
-
concurrent-ruby (~> 1.0, >= 1.
|
21
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
22
22
|
connection_pool (>= 2.2.5)
|
23
23
|
drb
|
24
24
|
i18n (>= 1.6, < 2)
|
25
25
|
logger (>= 1.4.2)
|
26
26
|
minitest (>= 5.1)
|
27
|
-
mutex_m
|
28
27
|
securerandom (>= 0.3)
|
29
|
-
tzinfo (~> 2.0)
|
28
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
30
29
|
appraisal (2.5.0)
|
31
30
|
bundler
|
32
31
|
rake
|
33
32
|
thor (>= 0.14.0)
|
34
33
|
base64 (0.3.0)
|
35
34
|
benchmark (0.4.1)
|
36
|
-
bigdecimal (3.
|
35
|
+
bigdecimal (3.3.1)
|
37
36
|
concurrent-ruby (1.3.5)
|
38
37
|
connection_pool (2.5.4)
|
39
|
-
diff-lcs (1.
|
38
|
+
diff-lcs (1.6.2)
|
40
39
|
drb (2.2.3)
|
41
40
|
i18n (1.14.7)
|
42
41
|
concurrent-ruby (~> 1.0)
|
43
42
|
logger (1.7.0)
|
44
|
-
|
45
|
-
minitest (5.25.5)
|
43
|
+
minitest (5.26.0)
|
46
44
|
mutex_m (0.3.0)
|
47
45
|
rake (12.3.3)
|
48
|
-
rspec (3.
|
49
|
-
rspec-core (~> 3.
|
50
|
-
rspec-expectations (~> 3.
|
51
|
-
rspec-mocks (~> 3.
|
52
|
-
rspec-core (3.
|
53
|
-
rspec-support (~> 3.
|
54
|
-
rspec-expectations (3.
|
46
|
+
rspec (3.13.1)
|
47
|
+
rspec-core (~> 3.13.0)
|
48
|
+
rspec-expectations (~> 3.13.0)
|
49
|
+
rspec-mocks (~> 3.13.0)
|
50
|
+
rspec-core (3.13.5)
|
51
|
+
rspec-support (~> 3.13.0)
|
52
|
+
rspec-expectations (3.13.5)
|
55
53
|
diff-lcs (>= 1.2.0, < 2.0)
|
56
|
-
rspec-support (~> 3.
|
57
|
-
rspec-mocks (3.
|
54
|
+
rspec-support (~> 3.13.0)
|
55
|
+
rspec-mocks (3.13.5)
|
58
56
|
diff-lcs (>= 1.2.0, < 2.0)
|
59
|
-
rspec-support (~> 3.
|
60
|
-
rspec-support (3.
|
57
|
+
rspec-support (~> 3.13.0)
|
58
|
+
rspec-support (3.13.6)
|
61
59
|
securerandom (0.4.1)
|
62
|
-
sqlite3 (1.7.3)
|
63
|
-
|
60
|
+
sqlite3 (1.7.3-aarch64-linux)
|
61
|
+
sqlite3 (1.7.3-arm-linux)
|
62
|
+
sqlite3 (1.7.3-arm64-darwin)
|
63
|
+
sqlite3 (1.7.3-x86-linux)
|
64
|
+
sqlite3 (1.7.3-x86_64-darwin)
|
65
|
+
sqlite3 (1.7.3-x86_64-linux)
|
64
66
|
thor (1.4.0)
|
65
67
|
timeout (0.4.3)
|
66
68
|
tzinfo (2.0.6)
|
67
69
|
concurrent-ruby (~> 1.0)
|
68
70
|
|
69
71
|
PLATFORMS
|
70
|
-
|
72
|
+
aarch64-linux
|
73
|
+
arm-linux
|
74
|
+
arm64-darwin
|
75
|
+
x86-linux
|
76
|
+
x86_64-darwin
|
77
|
+
x86_64-linux
|
71
78
|
|
72
79
|
DEPENDENCIES
|
73
80
|
appraisal (~> 2.4)
|
@@ -81,4 +88,4 @@ DEPENDENCIES
|
|
81
88
|
sqlite3 (~> 1.4)
|
82
89
|
|
83
90
|
BUNDLED WITH
|
84
|
-
2.
|
91
|
+
2.5.11
|
@@ -3,18 +3,18 @@
|
|
3
3
|
module PgbConnectionReaperRb
|
4
4
|
module PostgreSQLAdapterExtension
|
5
5
|
def reconnect!(**args)
|
6
|
-
|
7
|
-
|
8
|
-
@lock
|
9
|
-
else
|
10
|
-
# Rails 4.2
|
11
|
-
ActiveRecord::Base.connection_pool.instance_variable_get(:@mon_data)
|
12
|
-
end
|
13
|
-
|
14
|
-
lock.synchronize do
|
6
|
+
# Rails 7.1+ handles locking and disconnect/connect cycle internally
|
7
|
+
if ActiveRecord.version >= Gem::Version.new("7.1.0")
|
15
8
|
super
|
16
|
-
|
17
|
-
|
9
|
+
else
|
10
|
+
# Rails 6.x and earlier: ensure thread-safe reconnection with manual lock
|
11
|
+
lock = defined?(@lock) ? @lock : ActiveRecord::Base.connection_pool.instance_variable_get(:@mon_data)
|
12
|
+
|
13
|
+
lock.synchronize do
|
14
|
+
super
|
15
|
+
disconnect!
|
16
|
+
connect
|
17
|
+
end
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.summary = 'Gem for forcing cycling disconnections for Rails connections to PGBouncer'
|
12
12
|
spec.homepage = 'https://github.com/surgeventures/pgb_connection_reaper_rb'
|
13
13
|
spec.license = 'MIT'
|
14
|
-
spec.required_ruby_version = '>=
|
14
|
+
spec.required_ruby_version = '>= 3.1.0'
|
15
15
|
|
16
16
|
spec.metadata['homepage_uri'] = spec.homepage
|
17
17
|
spec.metadata['source_code_uri'] = 'https://github.com/surgeventures/pgb_connection_reaper_rb'
|
@@ -26,8 +26,8 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
27
|
spec.require_paths = ['lib']
|
28
28
|
|
29
|
-
spec.add_dependency 'activerecord', '>=
|
30
|
-
spec.add_dependency 'activesupport', '>=
|
29
|
+
spec.add_dependency 'activerecord', '>= 6.1'
|
30
|
+
spec.add_dependency 'activesupport', '>= 6.1'
|
31
31
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
32
32
|
spec.add_development_dependency 'appraisal', '~> 2.4'
|
33
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pgb_connection_reaper_rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Borisov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '6.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '6.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activesupport
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '6.1'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '6.1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -73,6 +73,7 @@ executables: []
|
|
73
73
|
extensions: []
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
|
+
- ".github/workflows/ci.yml"
|
76
77
|
- ".github/workflows/release.yml"
|
77
78
|
- ".gitignore"
|
78
79
|
- ".rspec"
|
@@ -110,7 +111,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
110
111
|
requirements:
|
111
112
|
- - ">="
|
112
113
|
- !ruby/object:Gem::Version
|
113
|
-
version:
|
114
|
+
version: 3.1.0
|
114
115
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
116
|
requirements:
|
116
117
|
- - ">="
|