timeouts in libpq- can libpq requests block forever/a very long time?
От | Dirk Niggemann |
---|---|
Тема | timeouts in libpq- can libpq requests block forever/a very long time? |
Дата | |
Msg-id | 37F64B68.60868E33@dircon.co.uk обсуждение исходный текст |
Ответы |
Re: [INTERFACES] timeouts in libpq- can libpq requests block forever/a very long time?
|
Список | pgsql-interfaces |
Hi, looking at the source for libpq- it looks like any requests using pqWait could block for a potentially (very) long time (e.g 15mins default TCP/ip timeout). This includes some requests using the asynchronous interface, particularly PQFlush will still block indefinitely (whereby indefinitely refers to "a period of time that makes the user think their app has hung"), and PQSendQuery will potentially block during the send.) Would there be any problems with changing pqWait so it uses a timeout? I would treat this timeout as equivalent to the socket having been closed unexpectedly- i.e. I would close the socket myself and then do the usual handling for an unexpectly closed socket, with the potential to return a different error... 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- how many system variants don't support setting O_NDELAY/O_NONBLOCK _before_ doing the connect (I know Linux and Solaris do, as for winsock, I couldn't even guess...) Is someone else already doing this work? Dirk
В списке pgsql-interfaces по дате отправления: