Skip to content

Commit

Permalink
Do not send redundant SIGQUITs
Browse files Browse the repository at this point in the history
If the worker reports itself as shutting down, do not send a SIGQUIT to the worker. It already knows it is shutting down, and this can cause a race with signal handlers that can trigger core dumps.
  • Loading branch information
brsakai-csco committed Jun 9, 2023
1 parent 68075c9 commit e39dc9f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/Mojo/Server/Prefork.pm
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,10 @@ sub _wait {
while ($chunk =~ /(\d+):(\d)\n/g) {
next unless my $w = $self->{pool}{$1};
@$w{qw(healthy time)} = (1, $time) and $self->emit(heartbeat => $1);
$w->{graceful} ||= $time if $2;
if ($2) {
$w->{graceful} ||= $time;
$w->{quit}++;
}
}
}

Expand Down

0 comments on commit e39dc9f

Please sign in to comment.