Re: Escaping from blocked send() reprised.

Andres Freund <andres@2ndquadrant.com>

From: Andres Freund <andres@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Heikki Linnakangas <hlinnakangas@vmware.com>, Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>, robertmhaas@gmail.com, pgsql-hackers@postgresql.org
Date: 2014-09-02T21:23:58Z
Lists: pgsql-hackers
On 2014-09-02 17:21:03 -0400, Tom Lane wrote:
> Heikki Linnakangas <hlinnakangas@vmware.com> writes:
> > I was going to suggest using WaitLatchOrSocket instead of sleeping in 1 
> > second increment, but I see that WaitLatchOrSocket() doesn't currently 
> > support waiting for a socket to become writeable, without also waiting 
> > for it to become readable. I wonder how difficult it would be to lift 
> > that restriction.
> 
> My recollection is that there was a reason for that, but I don't recall
> details any more.

http://git.postgresql.org/pg/commitdiff/e42a21b9e6c9b9e6346a34b62628d48ff2fc6ddf

In my prototype I've changed the API that errors set both
READABLE/WRITABLE. Seems to work....

Greetings,

Andres Freund

-- 
 Andres Freund	                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


Commits

  1. Assert that WaitLatchOrSocket callers cannot wait only for writability.