THRIFT-3848: Perl ForkingServer must ignore SIGCHLD to avoid infinite loop
Client: Perl
Patch: Jim King <jim.king@simplivity.com>
This closes #1040
diff --git a/lib/perl/lib/Thrift/Server.pm b/lib/perl/lib/Thrift/Server.pm
index 97e6620..ac1e17d 100644
--- a/lib/perl/lib/Thrift/Server.pm
+++ b/lib/perl/lib/Thrift/Server.pm
@@ -125,7 +125,6 @@
}
}
-
#
# SimpleServer from the Server base class that handles one connection at a time
#
@@ -191,6 +190,9 @@
{
my $self = shift;
+ # THRIFT-3848: without ignoring SIGCHLD, perl ForkingServer goes into a tight loop
+ $SIG{CHLD} = 'IGNORE';
+
$self->{serverTransport}->listen();
while (1)
{