Received: from sss.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id OAA81513 for ; Sat, 2 Oct 1999 14:44:32 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.sss.pgh.pa.us (8.9.1/8.9.1) with ESMTP id OAA08250; Sat, 2 Oct 1999 14:43:22 -0400 (EDT) To: Dirk Niggemann cc: pgsql-interfaces@postgreSQL.org Subject: Re: [INTERFACES] timeouts in libpq- can libpq requests block forever/a very long time? In-reply-to: Your message of Sat, 02 Oct 1999 19:14:00 +0100 <37F64B68.60868E33@dircon.co.uk> Date: Sat, 02 Oct 1999 14:43:22 -0400 Message-ID: <8248.938889802@sss.pgh.pa.us> From: Tom Lane Dirk Niggemann writes: > Would there be any problems with changing pqWait so it uses a timeout? I think this would be rather risky: if I issue a query that the backend takes a long time to compute, I don't want libpq timing out on me, *especially* not if its response is to close the connection rather than some fail-soft recovery technique. If the timeout is application-settable and defaults to infinity, it might be OK. In my own applications using the asynchronous query features, I have not seen any actual hangups that could be improved by a timeout ... but I've mostly been working across LAN rather than WAN connections... > I would also like to add a timeout for the connect operation on the > socket- > on a sufficiently frazzled WAN this could block for a long time- This might be useful, but again I wonder whether libpq ought to be second-guessing the transport system about how long is reasonable to wait for a response. regards, tom lane