Re: Re: Overhauling our interrupt handling (was Escaping from blocked send() reprised.) - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Re: Overhauling our interrupt handling (was Escaping from blocked send() reprised.)
Date
Msg-id 20150203185410.GA8303@awork2.anarazel.de
Whole thread Raw
In response to Re: Re: Overhauling our interrupt handling (was Escaping from blocked send() reprised.)  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: Re: Overhauling our interrupt handling (was Escaping from blocked send() reprised.)
List 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

pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: INSERT ... ON CONFLICT {UPDATE | IGNORE} 2.0
Next
From: Heikki Linnakangas
Date:
Subject: Re: Re: Overhauling our interrupt handling (was Escaping from blocked send() reprised.)