From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tim Allen <tim@proximity.com.au>
Cc: pgsql-interfaces@hub.org
Subject: Re: [INTERFACES] Peculiar behaviour in libpq
Date: Wed, 07 Jul 1999 10:18:46 -0400
Message-ID: <25895.931357126@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.10.9907071425230.13313-100000@bee.proximity.com.au>
Tim Allen <tim@proximity.com.au> writes:
> No, it's not the 'Z' message. What appears to be happening is that a
> select condition is occurring without there being any data to read from
> the socket. Inside PQconsumeInput(), which is calling pqReadData(), the
> call to recv() returns -1 with errno set to EAGAIN (I gather this is
> implementation dependent, and could be EWOULDBLOCK on some platforms).
> This happens after _every_ result, ie the result from a query gets
> returned, with the data being successfully read when select() says we can,
> and then one extra select condition occurs, with no data to read.
> So the mystery is, why does select() think there is something to read from
> the socket when recv() thinks not?
How odd. That sure sounds like a kernel bug to me.
> I was starting to suspect it could be merely an oddity of Linux's socket
> implementation, but discovered that the same behaviour occurs on SGI/IRIX.
Do you know whether Linux wrote their own Unix-socket code, or just
adopted the Berkeley socket code? This could be a common failure in
a lot of Unixes, if it's actually in the Berkeley code...
> This is a local (Unix domain) socket, btw, so it's not a TCP/IP issue.
Do you see the same behavior if you use a TCP connection?
regards, tom lane
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: tgl@sss.pgh.pa.us, tim@proximity.com.au, pgsql-interfaces@hub.org
Subject: Re: [INTERFACES] Peculiar behaviour in libpq
In-Reply-To: <25895.931357126@sss.pgh.pa.us>
* 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