Re: Latch-ifying the syslogger process

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Latch-ifying the syslogger process
Date: 2012-05-13 00:48:52
Message-ID: 17889.1336870132@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> While testing this I discovered a pre-existing bug in the Unix
> implementation of WaitLatchOrSocket: EOF on the socket is reported as
> POLLHUP not POLLIN (at least on my Linux box), which results in
> WaitLatchOrSocket going into an infinite loop, because poll() returns
> immediately but the result bitmask never becomes nonzero.

BTW, I just came across this in Microsoft's documentation of
WSAEventSelect:

Note that Windows Sockets will record only an FD_CLOSE network event
to indicate closure of a virtual circuit. It will not record an
FD_READ network event to indicate this condition.

which seems to me to indicate that the Windows version of
WaitLatchOrSocket has a related bug. We want socket EOF to result in
WL_SOCKET_READABLE being returned, no? Otherwise the caller may never
realize that it has an EOF condition to deal with.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2012-05-13 01:02:42 Re: Credit in the release notes WAS: Draft release notes complete
Previous Message Euler Taveira 2012-05-13 00:11:49 Re: Draft release notes complete