pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dirk Niggemann <dirk-n@dircon.co.uk>
To: pgsql-interfaces@postgresql.org
Subject: timeouts in libpq- can libpq requests block forever/a very long time?
Date: Sat, 02 Oct 1999 19:14:00 +0100
Message-ID: <37F64B68.60868E33@dircon.co.uk> (raw)

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



view thread (3+ messages)  latest in thread

Message-ID: <37F64B68.60868E33@dircon.co.uk>
Permalink:  ../37F64B68.60868E33@dircon.co.uk/
Also on:    postgresql.org/message-id/37F64B68.60868E33@dircon.co.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: dirk-n@dircon.co.uk
  Subject: Re: timeouts in libpq- can libpq requests block forever/a very long time?
  In-Reply-To: <37F64B68.60868E33@dircon.co.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox