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

Remove nio from status server #2516

Merged
merged 3 commits into from Dec 17, 2020
Merged
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 @@ -10,6 +10,7 @@
* Bugfixes
* Your bugfix goes here <Most recent on the top, like GitHub> (#Github Number)
* Fix compiler warnings, but skipped warnings related to ragel state machine generated code ([#1953])
* Fix phased restart errors related to nio4r gem when using the Puma control server (#2516)


## 5.1.1 / 2020-12-10
Expand Down
2 changes: 1 addition & 1 deletion lib/puma/runner.rb
Expand Up @@ -55,7 +55,7 @@ def start_control
app = Puma::App::Status.new @launcher, token

control = Puma::Server.new app, @launcher.events,
{ min_threads: 0, max_threads: 1 }
{ min_threads: 0, max_threads: 1, queue_requests: false }

control.binder.parse [str], self, 'Starting control server'

Expand Down
4 changes: 4 additions & 0 deletions test/config/prune_bundler_print_nio_defined.rb
@@ -0,0 +1,4 @@
prune_bundler true
before_fork do
puts "defined?(::NIO): #{defined?(::NIO).inspect}"
end
19 changes: 19 additions & 0 deletions test/test_integration_cluster.rb
Expand Up @@ -283,6 +283,25 @@ def test_json_gem_not_required_in_master_process
assert_match(/defined\?\(::JSON\): nil/, line)
end

def test_nio4r_gem_not_required_in_master_process
cli_server "-w #{workers} -C test/config/prune_bundler_print_nio_defined.rb test/rackup/hello.ru"

line = @server.gets
assert_match(/defined\?\(::NIO\): nil/, line)
end

def test_nio4r_gem_not_required_in_master_process_when_using_control_server
@control_tcp_port = UniquePort.call
control_opts = "--control-url tcp://#{HOST}:#{@control_tcp_port} --control-token #{TOKEN}"
cli_server "-w #{workers} #{control_opts} -C test/config/prune_bundler_print_nio_defined.rb test/rackup/hello.ru"

line = @server.gets
assert_match(/Starting control server/, line)

line = @server.gets
assert_match(/defined\?\(::NIO\): nil/, line)
end

def test_application_is_loaded_exactly_once_if_using_preload_app
cli_server "-w #{workers} --preload test/rackup/write_to_stdout_on_boot.ru"

Expand Down