1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Ignore forksafe threads for warning (#2475)

This commit is contained in:
Nate Berkopec 2020-11-02 12:37:55 -07:00 committed by GitHub
parent c1b6071ae3
commit b6ca443bb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -9,6 +9,7 @@
* Bugfixes
* Your bugfix goes here <Most recent on the top, like GitHub> (#Github Number)
* Ignore Rails' reaper thread (and any thread marked forksafe) for warning ([#2475])
* Ignore illegal (by Rack spec) response header ([#2439])
* Close idle connections immediately on shutdown ([#2460])
* Fix some instances of phased restart errors related to the `json` gem (#2473)

View file

@ -331,13 +331,15 @@ module Puma
log "* Process workers: #{@options[:workers]}"
before = Thread.list
# Threads explicitly marked as fork safe will be ignored.
# Used in Rails, but may be used by anyone.
before = Thread.list.reject { |t| t.thread_variable_get(:fork_safe) }
if preload?
log "* Preloading application"
load_and_bind
after = Thread.list
after = Thread.list.reject { |t| t.thread_variable_get(:fork_safe) }
if after.size > before.size
threads = (after - before)