Skip to content

Commit

Permalink
add stop timeout option
Browse files Browse the repository at this point in the history
  • Loading branch information
CamJN committed Dec 13, 2024
1 parent c7599c4 commit 657aff2
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
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

0 comments on commit 657aff2

Please sign in to comment.