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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.