Don't miss this part of the referenced documentation:
Firstly, remember that what we've done here is essentially revert to old style unsafe handling of these signals. So do as little as possible in the handler. Ideally just die(). Secondly, the handles in use at the time the signal is handled may not be safe to use afterwards.
Even if you do nothing but 'die' inside of your signal handler, the "unsafe" timing of when 'die' gets called can mean that some internal data structures of Perl or of the DBI driver get corrupted. It has been a while since I've had to deal with such, but on many prior occasions it was pretty normal for an unsafe signal to cause that instance of Perl to be corrupted about 5% of the time.
So you also need to do as little as possible after you get back from the 'eval' and you probably can't rely on those things always happening. And after you've tried to do those few things, you should 'exit' or 'die'.
- tye
In reply to Re^2: Using Alarms for MySQL DB (unsafe)
by tye
in thread Using Alarms for MySQL DB
by satishkumaryarru
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |