Re: Re: Cross-backend signals and administration (Was: Re: pg_terminate_backend for same-role) - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Re: Cross-backend signals and administration (Was: Re: pg_terminate_backend for same-role)
Date
Msg-id 20120327071559.GA25686@svana.org
Whole thread Raw
In response to Re: Cross-backend signals and administration (Was: Re: pg_terminate_backend for same-role)  (Greg Stark <stark@mit.edu>)
List pgsql-hackers
On Tue, Mar 27, 2012 at 03:17:36AM +0100, Greg Stark wrote:
> I may be forgetting something obvious here but is there even a
> function to send an interrupt signal? That would trigger the same
> behaviour that a user hitting C-c would trigger which would only be
> handled at the next CHECK_FOR_INTERRUPTS which seems like it would be
> non-controversial and iirc we don't currently have a function to do
> this for other connections the user may have if he doesn't have access
> to the original terminal and doesn't have raw shell access to run
> arbitrary commands.

Sure, C-c just sends a SIGINT. But IIRC the problem wasn't so much
cancelling running queries, SIGINT appears to work fine there, it's
that a connection blocked on waiting for client input doesn't wake up
when sent a signal. To fix that you'd need to change the signal mode
and teach the various input layers (like SSL) to handle the EINTR case.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> He who writes carelessly confesses thereby at the very outset that he does
> not attach much importance to his own thoughts.  -- Arthur Schopenhauer

pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: 9.2 commitfest closure (was Command Triggers, v16)
Next
From: Hitoshi Harada
Date:
Subject: Re: Odd out of memory problem.