On Fri, Mar 7, 2014 at 7:44 AM, Andres Freund <and...@2ndquadrant.com> wrote: > I've attached a new version of the walsender patch. It's been rebased > ontop of Heikki's latest commit to walsender.c. I've changed a fair bit > of stuff: > * The sleeptime is now computed to sleep until we either need to send a > keepalive or kill ourselves, as Heikki sugggested. > * Sleep time computation, sending pings, checking timeouts is now done > in separate functions. > * Comment and codestyle improvements. > > Although they are shorter and simpler now, I have not managed to unify > the three loops however. They seem to be too different to unify them > inside one. I tried a common function with an 'wait_for' bitmask > argument, but that turned out to be fairly illegible. The checks in > WalSndWaitForWal() and WalSndLoop() just seem to be too different. > > I'd be grateful if you (or somebody else!) could have a quick look at > body of the loops in WalSndWriteData(), WalSndWaitForWal() and > WalSndLoop(). Maybe I am just staring at it the wrong way.
I've committed this patch now with a few further tweaks, leaving this issue unaddressed. It may well be something that needs improvement, but I don't think it's a big enough issue to justify holding back a commit. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers