Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: apache2 mod_perl DBD/DBI postgres connection problems (alarm?)

by tye (Cardinal)
on Oct 12, 2011 at 01:20 UTC ( #930901=note: print w/ replies, xml ) Need Help??


in reply to apache2 mod_perl DBD/DBI postgres connection problems

Are you using alarm to time-out SQL queries? That will only work if you have "safe signals" turned off. This makes the signals... unsafe. I don't recall the exact errors that we ran into due to that, but yours certainly seem similar.

Empirical statistics suggest that about 10% of such firings of SIGALRM will result in the Perl interpreter becoming, shall we say, "unhappy". The safest thing is to just force the process to exit quickly after an unsafe signal gets processed.

I think Perl actually does things with "safe signals" that actually prevents a signal from interrupting an I/O operation. If so, that is quite unfortunate. If not, it might be fairly easy to build a patched version of the DBD module you are using such that interrupted I/O requests don't get restarted.

It is certainly very unfortunate that Perl can't safely time-out a DB operation.

- tye        


Comment on Re: apache2 mod_perl DBD/DBI postgres connection problems (alarm?)
Replies are listed 'Best First'.
Re^2: apache2 mod_perl DBD/DBI postgres connection problems (alarm?)
by otter117 (Initiate) on Oct 12, 2011 at 12:13 UTC
    Thanks for your reply. We do not use alarm at all. We have no code for timing out SQL queries.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (15)
As of 2015-08-05 12:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (81 votes), past polls