Skip to content

Commit

Permalink
starting new workers early is too dangerous
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 30, 2015
1 parent b58d7ad commit 92f9903
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 0 additions & 2 deletions Changes
Expand Up @@ -5,8 +5,6 @@
Mojo::Message.
- Improved Hypnotoad load balancing by calling srand() after starting a new
worker in Mojo::Server::Prefork.
- Improved Mojo::Server::Prefork to start a new worker as soon as and old
one signals that it is shutting down gracefully.
- Fixed bug in Mojo::DOM::CSS where combinators needed to be surrounded by
whitespace.

Expand Down
3 changes: 1 addition & 2 deletions lib/Mojo/Server/Prefork.pm
Expand Up @@ -107,8 +107,7 @@ sub _manage {

# Spawn more workers if necessary and check PID file
if (!$self->{finished}) {
$self->_spawn
while grep({ !$_->{graceful} } values %{$self->{pool}}) < $self->workers;
$self->_spawn while keys %{$self->{pool}} < $self->workers;
$self->ensure_pid_file;
}

Expand Down

0 comments on commit 92f9903

Please sign in to comment.