Re: Re: Cross-backend signals and administration (Was: Re: pg_terminate_backend for same-role)

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Greg Stark <stark(at)mit(dot)edu>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Daniel Farina <daniel(at)heroku(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Noah Misch <noah(at)leadboat(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: Cross-backend signals and administration (Was: Re: pg_terminate_backend for same-role)
Date: 2012-03-27 07:16:00
Message-ID: 20120327071559.GA25686@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hitoshi Harada 2012-03-27 07:22:10 Re: Odd out of memory problem.
Previous Message Magnus Hagander 2012-03-27 04:03:39 Re: 9.2 commitfest closure (was Command Triggers, v16)