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

add stop timeout option #2578

Open
wants to merge 1 commit into
base: stable-6.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Release 6.0.25 (Not yet released)
-------------
* [Standalone] Changes Passenger (not app) start and stop timeouts to 25s (from 15s) except for Nginx engine mode, which retains a stop timeout of 60s.
* [Standalone] Changes Passenger's (not apps') start timeout to 25s (from 15s), stop timeouts default to 60s.
* [Standalone] Adds a config option to specify the stop timeout for Passenger: `--stop-timeout 120` or `PASSENGER_STOP_TIMEOUT=120`.
*


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,12 @@ module Standalone
:type => :path,
:desc => 'Where to store the PID file'
},
{
:name => :stop_timeout,
:type => :integer,
:default => 60,
:desc => "How long in seconds to wait for the HTTP engine to gracefully shutdown,\nbefore killing it.\nDefault: %DEFAULT%"
},
{
:name => :instance_registry_dir,
:type => :path,
Expand Down Expand Up @@ -263,7 +269,7 @@ module Standalone
:type => :hostname,
:type_desc => 'HOST',
:default => '127.0.0.1',
:desc => "The address that Passenger binds to in order to allow sending HTTP requests to individual application processes.\nDefault: %DEFAULT%"
:desc => "The address that Passenger binds to in order to allow sending\nHTTP requests to individual application processes.\nDefault: %DEFAULT%"
},
{
:name => :static_files_dir,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ def build_daemon_controller_options
:ping_command => ping_spec,
:pid_file => @options[:pid_file],
:log_file => @options[:log_file],
:start_timeout => 25
:start_timeout => 25,
:stop_timeout => @options[:stop_timeout]
}
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def build_daemon_controller_options
:pid_file => @options[:pid_file],
:log_file => @options[:log_file],
:start_timeout => 25,
:stop_timeout => 60,
:stop_timeout => @options[:stop_timeout],
:log_file_activity_timeout => 12,
:dont_stop_if_pid_file_invalid => true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ def self.create_option_parser(options)
"Don't abort with an error if PID file cannot be found") do
options[:ignore_pid_not_found] = true
end
opts.on("-t", "--timeout NUMBER", Integer,
"How long in seconds to wait for the HTTP engine to#{nl}"+
"gracefully shutdown, before killing it.#{nl}" +
"Default: #{defaults[:stop_timeout]}") do |value|
options[:stop_timeout] = value
end
end
end

Expand Down Expand Up @@ -125,7 +131,7 @@ def create_controller
:ping_command => "true", # Doesn't matter
:pid_file => @options[:pid_file],
:log_file => "/dev/null",
:stop_timeout => 25
:stop_timeout => @options[:stop_timeout]
)
end
end
Expand Down
Loading