CHLD signals causing connection lost
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS |
New
|
Undecided
|
Unassigned |
Bug Description
I have encountered what I believe is a bug from a Perl script on CentOS 7 across multiple Percona versions. I cannot reproduce from the mysql cmd line utility that comes with Percona nor when using the MariaDB that comes with in distro.
In all tests I am using perl-DBD-mysql rpm that comes with the distro:
perl-DBD-
The test script:
================
#!/usr/bin/env perl
use Modern::Perl;
use DBI;
my $dbh = DBI->connect(
$dbh->{RaiseError} = 1;
$dbh->{PrintError} = 0;
$SIG{CHLD} = \&catch_child;
my $sql = qq{
select sleep(30)
};
say "my pid=$$";
$dbh->do($sql);
say "query done";
sub catch_child {
say "in catch_child()";
}
=======
Versions and results:
=======
$ rpm -qa | grep Percona
Percona-
Percona-
Percona-
<Terminal A>
-----------
$ ./junk.pl
my pid=11161
DBD::mysql::db do failed: Lost connection to MySQL server during query at ./junk.pl line 16.
in catch_child()
<Terminal B>
------------
$ kill -CHLD 11098
$ kill -CHLD 11098
$ kill -CHLD 11098
-bash: kill: (11098) - No such process
=======
$ rpm -qa | grep Percona
Percona-
Percona-
Percona-
<Terminal A>
-----------
$ ./junk.pl
my pid=11693
DBD::mysql::db do failed: Lost connection to MySQL server during query at ./junk.pl line 16.
in catch_child()
<Terminal B>
------------
$ kill -CHLD 11693
$ kill -CHLD 11693
$ kill -CHLD 11693
-bash: kill: (11693) - No such process
=======
$ rpm -qa | grep Percona
Percona-
Percona-
Percona-
<Terminal A>
-----------
$ ./junk.pl
my pid=13601
DBD::mysql::db do failed: Lost connection to MySQL server during query at ./junk.pl line 16.
in catch_child()
<Terminal B>
------------
$ kill -CHLD 13601
$ kill -CHLD 13601
$ kill -CHLD 13601
-bash: kill: (13601) - No such process
=======
$ rpm -qa | grep mariadb
mariadb-
mariadb-
mariadb-
<Terminal A>
-----------
$ ./junk.pl
my pid=15541
in catch_child()
query done
<Terminal B>
------------
$ kill -CHLD 15541
$ kill -CHLD 15541
$ kill -CHLD 15541
$ kill -CHLD 15541
$ kill -CHLD 15541
....
Just to clarify the four scenarios above.....
====
Vendor: Percona 26-rel74. 0.el7.x86_ 64
rpm version: 56-5.6.
mysql cmd line: ok
perl script: fail
====
Vendor: Percona 29-rel76. 2.el7.x86_ 64
rpm version: 56-5.6.
mysql cmd line: ok
perl script: fail
====
Vendor: Percona 11-4.1. el7.x86_ 64
rpm version: 57-5.7.
mysql cmd line: ok
perl script: fail
====
Vendor: MariaDB 1.el7_2. x86_64
rpm version: 5.5.47-
mysql cmd line: ok
perl script: ok