solid_queue_guard 1.3.0 → 1.3.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: d67d9fdbc9de83d8566bfc3c7529e4be2bf3e924cba7f840b555869cd0b2a618
4
- data.tar.gz: 63368e74ee06a570c18d7f7cd7ea56de72355ae84327f883a01233f1bee38cd5
3
+ metadata.gz: 437b060eb21ee49c674d1f5ddbb34471209bbecd11eef1a99a562249f134b1f1
4
+ data.tar.gz: 0fb8e3a58e206ee4a0b78a4c815efb7397c1d5d55e153360d7655eee21ff81fa
5
5
  SHA512:
6
- metadata.gz: 20bfa32ec7ae3b150414576877e57f432364f21df151082e6fd4a6d7da7c9b3802899223fcc33b37dc529b2ecf3a4723748b4a9ec30b5bd32fa168632cf73840
7
- data.tar.gz: 4b1553424fb1ad718edd40f22f06cf463837fc82bcb7350efd4c062b956cfd94a7cffdeb329460afbb23f17f40f0e30243b169c314c49f8679c41ed67ea89346
6
+ metadata.gz: 9fd08d490a2dff9d8e4915ed2742a660433c781a3244c321097715aac51c73729c91b5ad2cbcc90200c53c336c6a5f7cd80feb3eaebd426e025426700b5f1db5
7
+ data.tar.gz: da19ef71cf30e339ac2576a1749064f4ae904491bc0a67fdd61a9593feea6f2a48a051d13f260d6d0f739a43ed5aaddc5b5ef51e2183f98a58b36dbfdb3888bd
data/CHANGELOG.md CHANGED
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.3.1] - 2026-07-31
9
+
10
+ ### Fixed
11
+
12
+ - `thread_pool` and topology pool recommendations work with Solid Queue 1.6+, which renamed
13
+ `estimated_number_of_threads` to `estimated_database_pool_size`. Guard now reads whichever
14
+ private helper the installed gem exposes.
15
+
8
16
  ## [1.3.0] - 2026-07-29
9
17
 
10
18
  ### Changed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- solid_queue_guard (1.2.5)
4
+ solid_queue_guard (1.3.1)
5
5
  actionpack (>= 7.1, < 9.0)
6
6
  activejob (>= 7.1, < 9.0)
7
7
  activerecord (>= 7.1, < 9.0)
@@ -5,7 +5,7 @@ module SolidQueueGuard
5
5
  module Config
6
6
  class ThreadPoolCheck < Base
7
7
  def call
8
- required_threads = solid_queue_configuration.send(:estimated_number_of_threads)
8
+ required_pool = ConfigurationSizing.estimated_database_pool_size(solid_queue_configuration)
9
9
  pool_size = SolidQueue::Record.connection_pool&.size
10
10
 
11
11
  return skip('thread_pool', 'Queue database connection pool is not available') if pool_size.nil?
@@ -17,18 +17,18 @@ module SolidQueueGuard
17
17
  )
18
18
  end.max || 1
19
19
 
20
- if pool_size >= required_threads
20
+ if pool_size >= required_pool
21
21
  pass(
22
22
  'thread_pool',
23
23
  "Worker threads: #{max_worker_threads}, queue DB pool: #{pool_size}",
24
- metadata: { threads: max_worker_threads, pool: pool_size, required: required_threads }
24
+ metadata: { threads: max_worker_threads, pool: pool_size, required: required_pool }
25
25
  )
26
26
  else
27
27
  failure(
28
28
  'thread_pool',
29
29
  "Worker threads: #{max_worker_threads}, queue DB pool: #{pool_size}",
30
- suggestion: "Increase queue DB pool to at least #{required_threads} or reduce worker threads",
31
- metadata: { threads: max_worker_threads, pool: pool_size, required: required_threads }
30
+ suggestion: "Increase queue DB pool to at least #{required_pool} or reduce worker threads",
31
+ metadata: { threads: max_worker_threads, pool: pool_size, required: required_pool }
32
32
  )
33
33
  end
34
34
  end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SolidQueueGuard
4
+ # Reads Solid Queue's estimated queue-DB pool requirement across gem versions.
5
+ #
6
+ # Solid Queue 1.6 renamed the private helper from +estimated_number_of_threads+
7
+ # to +estimated_database_pool_size+ (fiber workers need a different estimate).
8
+ # Both return the same value for classic thread workers: max capacity + 2.
9
+ module ConfigurationSizing
10
+ module_function
11
+
12
+ def estimated_database_pool_size(configuration = SolidQueue::Configuration.new)
13
+ if configuration.respond_to?(:estimated_database_pool_size, true)
14
+ configuration.send(:estimated_database_pool_size)
15
+ elsif configuration.respond_to?(:estimated_number_of_threads, true)
16
+ configuration.send(:estimated_number_of_threads)
17
+ else
18
+ raise NoMethodError,
19
+ 'SolidQueue::Configuration has neither estimated_database_pool_size ' \
20
+ 'nor estimated_number_of_threads'
21
+ end
22
+ end
23
+ end
24
+ end
@@ -33,11 +33,11 @@ module SolidQueueGuard
33
33
  def pool_recommendations
34
34
  return async_pool_recommendation if PumaPluginSupport.async_supervisor_mode?
35
35
 
36
- required_threads = configuration.estimated_number_of_threads
36
+ required_pool = ConfigurationSizing.estimated_database_pool_size(configuration)
37
37
  pool_size = SolidQueue::Record.connection_pool&.size
38
- return [] if pool_size.nil? || required_threads <= pool_size
38
+ return [] if pool_size.nil? || required_pool <= pool_size
39
39
 
40
- ["Increase queue DB pool to at least #{required_threads + 2} (currently #{pool_size})"]
40
+ ["Increase queue DB pool to at least #{required_pool} (currently #{pool_size})"]
41
41
  rescue StandardError
42
42
  []
43
43
  end
@@ -62,11 +62,11 @@ module SolidQueueGuard
62
62
  end
63
63
 
64
64
  def async_pool_recommendation
65
- required_threads = configuration.estimated_number_of_threads
65
+ required_pool = ConfigurationSizing.estimated_database_pool_size(configuration)
66
66
  pool_size = SolidQueue::Record.connection_pool&.size
67
- return [] if pool_size.nil? || required_threads <= pool_size
67
+ return [] if pool_size.nil? || required_pool <= pool_size
68
68
 
69
- ["Increase queue DB pool to at least #{required_threads + 2} " \
69
+ ["Increase queue DB pool to at least #{required_pool} " \
70
70
  "for async supervisor mode (currently #{pool_size})"]
71
71
  rescue StandardError
72
72
  []
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidQueueGuard
4
- VERSION = '1.3.0'
4
+ VERSION = '1.3.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solid_queue_guard
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rafael Pissardo
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2026-07-29 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: actionpack
@@ -359,6 +358,7 @@ files:
359
358
  - lib/solid_queue_guard/checks/runtime/stale_process_check.rb
360
359
  - lib/solid_queue_guard/cli.rb
361
360
  - lib/solid_queue_guard/configuration.rb
361
+ - lib/solid_queue_guard/configuration_sizing.rb
362
362
  - lib/solid_queue_guard/engine.rb
363
363
  - lib/solid_queue_guard/formatters/json.rb
364
364
  - lib/solid_queue_guard/formatters/terminal.rb
@@ -394,7 +394,6 @@ metadata:
394
394
  bug_tracker_uri: https://github.com/rafael-pissardo/solid_queue_guard/issues
395
395
  documentation_uri: https://github.com/rafael-pissardo/solid_queue_guard#readme
396
396
  rubygems_mfa_required: 'true'
397
- post_install_message:
398
397
  rdoc_options: []
399
398
  require_paths:
400
399
  - lib
@@ -409,8 +408,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
409
408
  - !ruby/object:Gem::Version
410
409
  version: '0'
411
410
  requirements: []
412
- rubygems_version: 3.5.3
413
- signing_key:
411
+ rubygems_version: 3.6.9
414
412
  specification_version: 4
415
413
  summary: Production readiness checks and runtime guards for Rails Solid Queue.
416
414
  test_files: []