Re: [INTERFACES] timeouts in libpq- can libpq requests block forever/a very long time? - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: [INTERFACES] timeouts in libpq- can libpq requests block forever/a very long time?
Date
Msg-id 8248.938889802@sss.pgh.pa.us
Whole thread Raw
In response to timeouts in libpq- can libpq requests block forever/a very long time?  (Dirk Niggemann <dirk-n@dircon.co.uk>)
List pgsql-interfaces
Dirk Niggemann <dirk-n@dircon.co.uk> 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


pgsql-interfaces by date:

Previous
From: Lamar Owen
Date:
Subject: Re: [INTERFACES] PL_na undeclared
Next
From: John Cusick
Date:
Subject: Re: [INTERFACES] PL_na undeclared