On 2014-07-26 20:20:05 +0200, Andres Freund wrote: > On 2014-07-26 13:58:38 -0400, Tom Lane wrote: > > > Andres Freund <and...@2ndquadrant.com> writes: > > > That'd require either renegging on SA_RESTART or > > > using WaitLatchOrSocket() and nonblocking send/recv. > > > > Yeah, I was wondering about using WaitLatchOrSocket for client I/O too. > > We already have a hook that lets us do the actual recv even when using > > OpenSSL, and in principle that function could do interrupt-service-like > > functions if it got kicked off the recv(). > > I've started playing with this. Looks clearly worthwile. > > I think if we do it right we pretty much can get rid of the whole > prepare_for_client_read() machinery and handle everything via > ProcessInterrupts(). EnableCatchupInterrupt() et al don't really fill me > with joy.
One thing I am wondering about around this is: Why are we only processing catchup events when DoingCommandRead? There's other paths where we can wait for data from the client for a long time. Obviously we don't want to process async.c stuff from inside copy, but I don't see why that's the case for sinval.c. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers