Re: Re: Overhauling our interrupt handling (was Escaping from blocked send() reprised.)

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: Re: Overhauling our interrupt handling (was Escaping from blocked send() reprised.)
Date: 2015-02-03 18:54:10
Message-ID: 20150203185410.GA8303@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Here's the last, rebased (took a while...), version of this
patchset. I've fixed the things that Heikki mentioned (except the one
"stray" CFI, which imo maskes sense).

Besides a fair number of cosmetic changes there are two somewhat
important ones:

* I previously had removed the win32 waitforsinglesocket calls in the
openssl code - they're now just always replaced with latch waits. The
windows case makes actually much more sense, as we previously just
busylooped in the !win32 case.
* Previously the patchset didn't handle SIGTERM while
InteractiveBackend() was reading from the client. It did handle
ctrl-c/d, but since getc() isn't interruptible and can't be replaced
with latches... The fix for that isn't super pretty:
die():
if (DoingCommandRead && whereToSendOutput != DestRemote)
ProcessInterrupts();
but imo acceptable for single user mode.

Unless someone announces the intent do review them some more, I plan to
push the attached patches fairly soon. I'm not claiming at all they're
bug free, but I think at this stage it's better to get them in.

I plan to pursue the remaining patches (latch optimizations, lwlock
using latches, possibly removing PGPROC.sem) afterwards.

Greetings,

Andres Freund

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

Attachment Content-Type Size
0001-Use-a-nonblocking-socket-for-FE-BE-communication-and.patch text/x-patch 8.7 KB
0002-Introduce-and-use-infrastructure-for-interrupt-proce.patch text/x-patch 36.6 KB
0003-Process-die-interrupts-while-reading-writing-from-th.patch text/x-patch 8.8 KB
0004-Don-t-allow-immediate-interrupts-during-authenticati.patch text/x-patch 8.4 KB
0005-Move-deadlock-and-other-interrupt-handling-in-proc.c.patch text/x-patch 11.6 KB
0006-Remove-the-option-to-service-interrupts-during-PGSem.patch text/x-patch 7.6 KB
0007-Remove-remnants-of-ImmediateInterruptOK-handling.patch text/x-patch 11.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2015-02-03 20:17:22 Re: Re: Overhauling our interrupt handling (was Escaping from blocked send() reprised.)
Previous Message Peter Geoghegan 2015-02-03 18:17:25 Re: INSERT ... ON CONFLICT {UPDATE | IGNORE} 2.0