Subject: | Signal cathcing inside execute method will raise the "Lost connection to MySQL..." |
Hello,
I noticed the strong problem
I have stable fork of MySQL server - Percona server, version 5.5.30
I have installed libraries from Percona too of course (i think these libraries work same as original MySQL libraries because Percona is fork of MySQL with improvements in sql engines)
And i have a fresh version DBI & DBD::mysql at this moment (2013-05-29)
If i use in program often the "execute" method in my program and if my program to be terminated by signal TERM (i catch this signal by $SIG{TERM}) and if signal occurs inside "execute" method - i got strong error "DBD::mysql::st execute failed: Lost connection to MySQL server during query at ..."
I know about deferred signals in Perl. I used other catching method as well - through using POSIX::sigaction ( https://metacpan.org/module/RJBS/perl-5.18.0/pod/perlipc.pod#Deferred-Signals-Safe-Signals ) but this doesn't help. Again and again if my program catch signal inside execute i got "Lost connection...". Please notice i don't use any I/O functions inside signal handler. I have there only one variable assigning.
Normally i want to make a following: i have local $SIG{TERM} = sub { $term = 1 } inside perl block where often to be run an "execute" method and i want only to finish my transaction which does more execute runs. But now i cannot make it. Only one way works - if before an each "execute" call in program i will use local $SIG{TERM} = 'IGNORE'. But this bad way - sometimes i cannot stop program - i should send to program more times the signal TERM for termination because often i have an ignoring TERM situation. And i cannot use everywhere in program ignoring signal before each "execute" statement. So i cannot have a normal daemons programs using DBD::mysql & signal termination.
I think this problem will occur if i will catch any signal if this problem is related with EINTR errno in read & write system calls. But i use many other I/O operations (memcached & beanstalkd daemons) in my daemon programs and i see only with mysql's executes.