Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: On timing out with ALRM

by samtregar (Abbot)
on Jul 25, 2007 at 17:00 UTC ( #628728=note: print w/replies, xml ) Need Help??

in reply to On timing out with ALRM

This is quite similar to the problem I solved with DBIx::Timeout. In that case I needed to timeout long DB queries but I couldn't rely on signals to do it safely. My solution was to fork off a process that waits until the timeout occurs and then kills the DB connection. In your case you'd probably have to fork the long-running code and then end it with kill(). It's not what you'd call a light-weight solution but it should work...

Of course, an alternative would be to fix the code! Evals that throws away errors are really worth the time to fix. I've been bitten by that beast more than once while working on inherited code and it's amazing how much work they can cause when error messages for relatively simple problems just aren't getting to the error logs!


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://628728]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2019-07-17 12:58 GMT
Find Nodes?
    Voting Booth?

    No recent polls found