puma 7.0.1 → 7.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e662aa9214837e2d08713550a828fe7ae8bdefe1eac79c9def581a6e089745b
4
- data.tar.gz: 70dab329bbcf71e4ae4da042591eb8311de4c729e3c8d334d7c0ddc20bcf7aa4
3
+ metadata.gz: 27238c0a5b2fe438167c0f56d89da2bded024ea017cdb903be3517cab2e826b6
4
+ data.tar.gz: d18f43c13332384208ea7e941e8ff01f6fdbd2ff74b36b978200737b4b8ac125
5
5
  SHA512:
6
- metadata.gz: 379e3b2c89c03169805ec2c67e4ab43bb9af1a32d23a8f5f58dc0fc3d958ca34bdcc7390d656613357a5dbb86c1f8fa9b403d40e95cecb518a4c7b2415e65a05
7
- data.tar.gz: 2981fa2d413989754a70c0c3a2df62a0efbcb8529b66cf78d6df917751d220bdd7b842ece6536ed789547b063b83498eb1c81bb37507e2289a8728929bfbcf34
6
+ metadata.gz: 5381aede9f16b8bb80d8f45ce6c892ee337b1ce9528a9073bf3a0369bd86f475eab5e3c77e3f217e082939d2fdc680bed9fd44ff9e817b5c0d3bfd8ee74be810
7
+ data.tar.gz: 588e29319e59120aa21853ccd88e9ecec589cd488e6284e6fe8d036d363fa77e8bc5997e70f1d9d7b07ba02b9735bee70873bf7b1b454f07475aaa374ebd96af
data/History.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 7.0.2 / 2025-09-08
2
+
3
+ * Bugfixes
4
+ * bug: control_cli.rb - Fixup `pumactl` code to load puma.rb for `deprecate_method_change` ([#3736], [#3734])
5
+ * Replace sleep spin lock with condition variable ([#3729])
6
+ * Fix Puma not booting if queue_requests disabled ([#3731])
7
+
1
8
  ## 7.0.1 / 2025-09-06
2
9
 
3
10
  * Bugfixes
@@ -2219,6 +2226,10 @@ be added back in a future date when a java Puma::MiniSSL is added.
2219
2226
  * Bugfixes
2220
2227
  * Your bugfix goes here <Most recent on the top, like GitHub> (#Github Number)
2221
2228
 
2229
+ [#3736]:https://github.com/puma/puma/pull/3736 "PR by @MSP-Greg, merged 2025-09-08"
2230
+ [#3734]:https://github.com/puma/puma/issues/3734 "Issue by @espen, closed 2025-09-08"
2231
+ [#3729]:https://github.com/puma/puma/pull/3729 "PR by @bensheldon, merged 2025-09-08"
2232
+ [#3731]:https://github.com/puma/puma/pull/3731 "PR by @stanhu, merged 2025-09-06"
2222
2233
  [#3725]:https://github.com/puma/puma/pull/3725 "PR by @tannakartikey, merged 2025-09-05"
2223
2234
  [#3719]:https://github.com/puma/puma/pull/3719 "PR by @schneems, merged 2025-09-03"
2224
2235
  [#3378]:https://github.com/puma/puma/pull/3378 "PR by @shayonj, merged 2025-08-19"
@@ -73,6 +73,8 @@ module Puma
73
73
  # check stat max values, we can't signal workers to reset the max values,
74
74
  # so we do so here
75
75
  WORKER_MAX_KEYS.each_with_index do |key, idx|
76
+ next unless hsh[key]
77
+
76
78
  if hsh[key] < @worker_max[idx]
77
79
  hsh[key] = @worker_max[idx]
78
80
  else
data/lib/puma/const.rb CHANGED
@@ -100,7 +100,7 @@ module Puma
100
100
  # too taxing on performance.
101
101
  module Const
102
102
 
103
- PUMA_VERSION = VERSION = "7.0.1"
103
+ PUMA_VERSION = VERSION = "7.0.2"
104
104
  CODE_NAME = "Romantic Warrior"
105
105
 
106
106
  PUMA_SERVER_STRING = ["puma", PUMA_VERSION, CODE_NAME].join(" ").freeze
@@ -124,6 +124,9 @@ module Puma
124
124
  end
125
125
 
126
126
  if @config_file
127
+ # needed because neither `Puma::CLI` or `Puma::Server` are loaded
128
+ require_relative '../puma'
129
+
127
130
  require_relative 'configuration'
128
131
  require_relative 'log_writer'
129
132
 
data/lib/puma/request.rb CHANGED
@@ -273,11 +273,17 @@ module Puma
273
273
  !shutting_down? && keep_alive
274
274
  end
275
275
 
276
+ HTTP_ON_VALUES = { "on" => true, HTTPS => true }
277
+ private_constant :HTTP_ON_VALUES
278
+
276
279
  # @param env [Hash] see Puma::Client#env, from request
277
280
  # @return [Puma::Const::PORT_443,Puma::Const::PORT_80]
278
281
  #
279
282
  def default_server_port(env)
280
- if ['on', HTTPS].include?(env[HTTPS_KEY]) || env[HTTP_X_FORWARDED_PROTO].to_s[0...5] == HTTPS || env[HTTP_X_FORWARDED_SCHEME] == HTTPS || env[HTTP_X_FORWARDED_SSL] == "on"
283
+ if HTTP_ON_VALUES[env[HTTPS_KEY]] ||
284
+ env[HTTP_X_FORWARDED_PROTO]&.start_with?(HTTPS) ||
285
+ env[HTTP_X_FORWARDED_SCHEME] == HTTPS ||
286
+ env[HTTP_X_FORWARDED_SSL] == "on"
281
287
  PORT_443
282
288
  else
283
289
  PORT_80
data/lib/puma/server.rb CHANGED
@@ -382,7 +382,7 @@ module Puma
382
382
  else
383
383
  # if ThreadPool out_of_band code is running, we don't want to add
384
384
  # clients until the code is finished.
385
- sleep 0.001 while pool.out_of_band_running
385
+ pool.wait_while_out_of_band_running
386
386
 
387
387
  # only use delay when clustered and busy
388
388
  if pool.busy_threads >= @max_threads
@@ -685,13 +685,13 @@ module Puma
685
685
  stats = @thread_pool&.stats || {}
686
686
  stats[:max_threads] = @max_threads
687
687
  stats[:requests_count] = @requests_count
688
- stats[:reactor_max] = @reactor.reactor_max
688
+ stats[:reactor_max] = @reactor.reactor_max if @reactor
689
689
  reset_max
690
690
  stats
691
691
  end
692
692
 
693
693
  def reset_max
694
- @reactor.reactor_max = 0
694
+ @reactor.reactor_max = 0 if @reactor
695
695
  @thread_pool.reset_max
696
696
  end
697
697
 
@@ -53,6 +53,7 @@ module Puma
53
53
  @block = block
54
54
  @out_of_band = options[:out_of_band]
55
55
  @out_of_band_running = false
56
+ @out_of_band_condvar = ConditionVariable.new
56
57
  @before_thread_start = options[:before_thread_start]
57
58
  @before_thread_exit = options[:before_thread_exit]
58
59
  @reaping_time = options[:reaping_time]
@@ -227,10 +228,19 @@ module Puma
227
228
  true
228
229
  ensure
229
230
  @out_of_band_running = false
231
+ @out_of_band_condvar.broadcast
230
232
  end
231
233
 
232
234
  private :trigger_out_of_band_hook
233
235
 
236
+ def wait_while_out_of_band_running
237
+ return unless @out_of_band_running
238
+
239
+ with_mutex do
240
+ @out_of_band_condvar.wait(@mutex) while @out_of_band_running
241
+ end
242
+ end
243
+
234
244
  # @version 5.0.0
235
245
  def with_mutex(&block)
236
246
  @mutex.owned? ?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puma
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.1
4
+ version: 7.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Phoenix