Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix out_of_band hook never executed when multiple worker threads (clo… #2178

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions History.md
Expand Up @@ -24,6 +24,7 @@
* Rescue IO::WaitReadable instead of EAGAIN for blocking read (#2121)
* Ensure `BUNDLE_GEMFILE` is unspecified in workers if unspecified in master when using `prune_bundler` (#2154)
* Rescue and log exceptions in hooks defined by users (on_worker_boot, after_worker_fork etc) (#1551)
* Fix `out_of_band` hook never executed if the number of worker threads is > 1 (#2177)

* Refactor
* Remove unused loader argument from Plugin initializer (#2095)
Expand Down
2 changes: 1 addition & 1 deletion lib/puma/server.rb
Expand Up @@ -291,7 +291,7 @@ def handle_servers

pool << client
busy_threads = pool.wait_until_not_full
if busy_threads == 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, the problem here is that if busy_threads != 0, it's not really out of band anymore, is it?

if busy_threads < @max_threads
@options[:out_of_band].each(&:call) if @options[:out_of_band]
end
end
Expand Down