puma 8.0.0 → 8.0.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: 9b99ab5935b1e99868b96ec9035d05ed00930f4b001053ec99d52a55b6d3eb18
4
- data.tar.gz: 6142fbf02efbf35ad5b723715d0a7e080add67f574aeaf16b87e42cc7c54e181
3
+ metadata.gz: b4bda2b8a9ed5838776f890077459a3db57a8a581b17516434ba9b9cbd5d0f71
4
+ data.tar.gz: 621365fbc4837c30dc8c7d32de00ceadbcf80db735ae2388aeb0b521414a1b3c
5
5
  SHA512:
6
- metadata.gz: 4910a1d1200b6c49bf2c32fb569c66d704fd3cd833fce0d2a62da4856ffd6984818fc0a460d02e8acb599a5ea82a83c94ace92530c0cd53d2955400b8b79497c
7
- data.tar.gz: 2f726e8fc621aa245c927b7ad9113e33c3d35c78a832bf39363b54e09962e9866e441d3bed2069281d9f17d6bc21839167588df89572dba239e35d11d8e5525c
6
+ metadata.gz: 321cc06d7e4f77147aeeb44b29b7de9627b5942ef374b93f64a5aa89c85414c761c79833ba61e6accb0fee53ee68cc91f07121d7a74ab106a1091885e806b123
7
+ data.tar.gz: eb9e6c89473875970b71d2fec792e68c1355ab0dff2dc6d887cd7221449c5c9e20f7030ec3bc3ed8edb18ff50c906697067325a86d040bdc9bfedb5d74566454
data/History.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## 8.0.1 / 2026-04-27
2
+
3
+ * Bugfixes
4
+ * Fix `prune_bundler` stripping user-configured `BUNDLE_*` env vars (e.g. `BUNDLE_WITHOUT`) on re-exec, which caused workers to crash on boot ([#3929])
5
+
6
+ * Performance
7
+ * Use blocks for debug logging to avoid creating log messages when debug is disabled ([#3920])
8
+
9
+ * Docs
10
+ * Fix incorrect hook names in gRPC docs ([#3923])
11
+ * Reword v8 upgrade guide IPv6 bullet for clarity ([#3928])
12
+
1
13
  ## 8.0.0 / 2026-03-27
2
14
 
3
15
  * Features
@@ -2323,6 +2335,10 @@ be added back in a future date when a java Puma::MiniSSL is added.
2323
2335
  * Bugfixes
2324
2336
  * Your bugfix goes here <Most recent on the top, like GitHub> (#Github Number)
2325
2337
 
2338
+ [#3929]:https://github.com/puma/puma/pull/3929 "PR by Joshua Young, merged 2026-04-26"
2339
+ [#3928]:https://github.com/puma/puma/pull/3928 "PR by Nate Berkopec, merged 2026-04-16"
2340
+ [#3923]:https://github.com/puma/puma/pull/3923 "PR by Joshua Young, merged 2026-04-10"
2341
+ [#3920]:https://github.com/puma/puma/pull/3920 "PR by Petrik de Heus, merged 2026-04-10"
2326
2342
  [#3912]:https://github.com/puma/puma/pull/3912 "PR by Bengt-Ove Hollaender, merged 2026-03-26"
2327
2343
  [#3900]:https://github.com/puma/puma/pull/3900 "PR by Nate Berkopec, merged 2026-03-26"
2328
2344
  [#3894]:https://github.com/puma/puma/pull/3894 "PR by Joshua Young, merged 2026-03-07"
data/docs/8.0-Upgrade.md CHANGED
@@ -91,7 +91,7 @@ bind 'tcp://0.0.0.0:9292'
91
91
 
92
92
  Check the following list to see if you're depending on any of these behaviors:
93
93
 
94
- 1. If you rely on Puma's default bind from `bin/puma`, Rack handler startup, `port`, or an implicit config file bind, Puma may now listen on `::` and advertise `tcp://[::]:PORT` whenever a non-loopback IPv6 interface is present. If you need the old IPv4 wildcard behavior, set `bind 'tcp://0.0.0.0:9292'`, `port ENV.fetch('PORT', 9292), '0.0.0.0'`, or `set_default_host '0.0.0.0'` explicitly, and review any firewall rules, health checks, deploy scripts, or host-string parsing code that assumed `0.0.0.0` or unbracketed `HOST:PORT` formatting.
94
+ 1. Puma will now listen on `::` (IPv6) by default. Previously, it listened to `0.0.0.0` (IPv4). Systems that support both IPv6 and IPv4 (Ubuntu and Mac commonly do) will still support receiving to `0.0.0.0`. See [[the support table in the PR](https://github.com/puma/puma/pull/3847)](https://github.com/puma/puma/pull/3847) for a binding compatibility. For systems that ONLY bind to IPv6 (without IPv4 support) this may be a breaking change. You can overwrite this default behavior by setting `bind 'tcp://0.0.0.0:9292'`, `port ENV.fetch('PORT', 9292), '0.0.0.0'`, or `set_default_host '0.0.0.0'` explicitly to remain IPv4 only. Review any firewall rules, health checks, deploy scripts, or host-string parsing code that assumed `0.0.0.0`, `127.0.0.1`, or unbracketed `HOST:PORT` formatting.
95
95
  2. If you explicitly configure `bind 'tcp://[::]:...'`, `bind 'ssl://[::]:...'`, or equivalent `ssl_bind '::', ...`, Puma will now rewrite that unspecified IPv6 bind to `0.0.0.0` when the host has no non-loopback IPv6 interface, and it will warn on boot. If you were using `::` to force IPv6-only behavior or to detect IPv6 availability, switch to a concrete IPv6 address instead of `::`, or ensure the machine actually has a usable IPv6 interface before Puma starts.
96
96
  3. `before_thread_start` hooks now receive a `Puma::ServerPluginControl` argument. Update any zero-arity lambdas, method objects, or other strict-arity hook code to accept one argument, for example `before_thread_start { |_control| ... }`, or Puma can raise `ArgumentError` when the hook runs.
97
97
  4. On platforms without `SIGINFO`, Puma now traps `SIGPWR`, and `pumactl info` sends `SIGPWR` there. If your supervisor, init script, or container tooling already uses `SIGPWR` for something else, change that wiring before upgrading and update any runbooks that assumed Puma would ignore `SIGPWR`.
data/docs/grpc.md CHANGED
@@ -15,7 +15,7 @@ To work correctly, gRPC needs these methods called at specific points in the pro
15
15
  - `GRPC.postfork_child`: Called in the child process after forking.
16
16
  - `GRPC.postfork_parent`: Called in the parent process after forking.
17
17
 
18
- Puma provides hooks such as `on_worker_fork`, `after_worker_fork`, and `on_worker_boot` to execute code during these lifecycle events. Understanding the behavior of these hooks is key to ensuring gRPC operates correctly in a clustered setup.
18
+ Puma provides hooks such as `before_worker_fork`, `after_worker_fork`, and `before_worker_boot` to execute code during these lifecycle events. Understanding the behavior of these hooks is key to ensuring gRPC operates correctly in a clustered setup.
19
19
 
20
20
  ## The Solution
21
21
 
@@ -45,7 +45,7 @@ end
45
45
 
46
46
  Puma's hooks determine when to call gRPC's lifecycle methods. Each hook plays a specific role in managing the lifecycle during forking:
47
47
 
48
- - **`on_worker_fork`**:
48
+ - **`before_worker_fork`**:
49
49
  - This hook runs before forking workers and is where you call `GRPC.prefork`.
50
50
  - In preloading setups (default in Puma v7), it runs in the **master process** before workers are forked, as the application is preloaded in the master process.
51
51
  - Without preloading, it still runs in the **master process** before forking workers, but the application is not preloaded.
@@ -55,7 +55,7 @@ Puma's hooks determine when to call gRPC's lifecycle methods. Each hook plays a
55
55
  - This hook always runs in the **master process** after a worker is forked, regardless of whether preloading is enabled.
56
56
  - Call `GRPC.postfork_parent` here to finalize the master process's state after forking.
57
57
 
58
- - **`on_worker_boot`**:
58
+ - **`before_worker_boot`**:
59
59
  - This hook always runs in the **worker process** after it is forked, regardless of whether preloading is enabled.
60
60
  - Call `GRPC.postfork_child` here to finalize the worker's state.
61
61
 
data/lib/puma/binder.rb CHANGED
@@ -90,7 +90,7 @@ module Puma
90
90
  # @version 5.0.0
91
91
  #
92
92
  def create_activated_fds(env_hash)
93
- @log_writer.debug "ENV['LISTEN_FDS'] #{@env['LISTEN_FDS'].inspect} env_hash['LISTEN_PID'] #{env_hash['LISTEN_PID'].inspect}"
93
+ @log_writer.debug { "ENV['LISTEN_FDS'] #{@env['LISTEN_FDS'].inspect} env_hash['LISTEN_PID'] #{env_hash['LISTEN_PID'].inspect}" }
94
94
  return [] unless env_hash['LISTEN_FDS'] && env_hash['LISTEN_PID'].to_i == $$
95
95
  env_hash['LISTEN_FDS'].to_i.times do |index|
96
96
  sock = TCPServer.for_fd(socket_activation_fd(index))
@@ -102,7 +102,7 @@ module Puma
102
102
  [:tcp, addr, port]
103
103
  end
104
104
  @activated_sockets[key] = sock
105
- @log_writer.debug "Registered #{key.join ':'} for activation from LISTEN_FDS"
105
+ @log_writer.debug { "Registered #{key.join ':'} for activation from LISTEN_FDS" }
106
106
  end
107
107
  ["LISTEN_FDS", "LISTEN_PID"] # Signal to remove these keys from ENV
108
108
  end
@@ -344,7 +344,7 @@ module Puma
344
344
  # @param arg [Launcher, Int] `:before_restart` passes Launcher
345
345
  #
346
346
  def run_hooks(key, arg, log_writer, hook_data = nil)
347
- log_writer.debug "Running #{key} hooks"
347
+ log_writer.debug { "Running #{key} hooks" }
348
348
 
349
349
  options.all_of(key).each do |hook_options|
350
350
  begin
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 = "8.0.0"
103
+ PUMA_VERSION = VERSION = "8.0.1"
104
104
  CODE_NAME = "Into the Arena"
105
105
 
106
106
  PUMA_SERVER_STRING = ["puma", PUMA_VERSION, CODE_NAME].join(" ").freeze
@@ -28,14 +28,12 @@ module Puma
28
28
 
29
29
  log '* Pruning Bundler environment'
30
30
  home = ENV['GEM_HOME']
31
- bundle_gemfile = Bundler.original_env['BUNDLE_GEMFILE']
32
- bundle_app_config = Bundler.original_env['BUNDLE_APP_CONFIG']
31
+ original_bundle_env = Bundler.original_env.select { |k, v| k.start_with?('BUNDLE_') && v }
33
32
 
34
33
  with_unbundled_env do
35
34
  ENV['GEM_HOME'] = home
36
- ENV['BUNDLE_GEMFILE'] = bundle_gemfile
37
35
  ENV['PUMA_BUNDLER_PRUNED'] = '1'
38
- ENV["BUNDLE_APP_CONFIG"] = bundle_app_config
36
+ original_bundle_env.each { |k, v| ENV[k] = v }
39
37
  args = [Gem.ruby, puma_wild_path, '-I', dirs.join(':')] + @original_argv
40
38
  # Defaults to true which breaks socket activation
41
39
  args += [{:close_others => false}]
@@ -90,8 +90,14 @@ module Puma
90
90
  @debug
91
91
  end
92
92
 
93
- def debug(str)
94
- log("% #{str}") if @debug
93
+ def debug(str=nil, &block)
94
+ if @debug
95
+ if block_given?
96
+ log("% #{yield}")
97
+ else
98
+ log("% #{str}")
99
+ end
100
+ end
95
101
  end
96
102
 
97
103
  # Write +str+ to +@stderr+
data/lib/puma/server.rb CHANGED
@@ -417,7 +417,7 @@ module Puma
417
417
  end
418
418
  end
419
419
 
420
- @log_writer.debug "Drained #{drain} additional connections." if drain
420
+ @log_writer.debug { "Drained #{drain} additional connections." } if drain
421
421
  @events.fire :state, @status
422
422
 
423
423
  if queue_requests
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: 8.0.0
4
+ version: 8.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Phoenix