Skip to content

Commit

Permalink
increase default upgrade_timeout from 60 to 180 seconds in Mojo::Serv…
Browse files Browse the repository at this point in the history
…er::Hypnotoad
  • Loading branch information
kraih committed Jan 8, 2018
1 parent 0db273f commit aeb1793
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Changes
@@ -1,5 +1,7 @@

7.61 2018-01-03
7.61 2018-01-08
- Increased default upgrade_timeout from 60 to 180 seconds in
Mojo::Server::Hypnotoad.

7.60 2018-01-02
- Deprecated use of Mojo::Promise::all and Mojo::Promise::race as instance
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/Server/Hypnotoad.pm
Expand Up @@ -10,7 +10,7 @@ use Mojo::Util 'steady_time';
use Scalar::Util 'weaken';

has prefork => sub { Mojo::Server::Prefork->new(listen => ['http://*:8080']) };
has upgrade_timeout => 60;
has upgrade_timeout => 180;

sub configure {
my ($self, $name) = @_;
Expand Down Expand Up @@ -352,7 +352,7 @@ drastically reducing the performance cost of worker restarts.
upgrade_timeout => 45
Maximum amount of time in seconds a zero downtime software upgrade may take
before getting canceled, defaults to C<60>.
before getting canceled, defaults to C<180>.
=head2 workers
Expand Down
4 changes: 2 additions & 2 deletions t/mojo/hypnotoad.t
Expand Up @@ -33,7 +33,7 @@ use Mojo::UserAgent;
upgrade_timeout => 45,
workers => 7
};
is $hypnotoad->upgrade_timeout, 60, 'right default';
is $hypnotoad->upgrade_timeout, 180, 'right default';
$hypnotoad->configure('test');
is_deeply $hypnotoad->prefork->listen, ['http://*:8080'], 'right value';
$hypnotoad->configure('myserver');
Expand Down Expand Up @@ -259,7 +259,7 @@ sleep 1 while _port($port2);
# Check log
$log = $log->slurp;
like $log, qr/Worker \d+ started/, 'right message';
like $log, qr/Starting zero downtime software upgrade \(60 seconds\)/,
like $log, qr/Starting zero downtime software upgrade \(180 seconds\)/,
'right message';
like $log, qr/Upgrade successful, stopping $old/, 'right message';

Expand Down

0 comments on commit aeb1793

Please sign in to comment.