Stuck connection/query?

Brien Voorhees <[email protected]> Tue, 15 Jun 2010 14:43:47 -0700
Newsgroups gmane.comp.python.db.psycopg.devel
Message-ID <[email protected]>
Greetings,
I have a long-running python program that continually cycles through a 
list of servers and queries them to retrieve data.  Occasionally (every 
few days) it will get stuck in a pyscopg2 function call.   For 
reference, the program is running on linux and using psycopg2 2.0.14 
with python 2.6.

I've seen it get stuck in both cur.execute() and also in 
pyscopg2.connect().   I'm guessing it's due to some network error or an 
unresponsive postgres server.

Is there any way to specify a timeout or some other recommended solution?

Thanks
-Brien