pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: eshkinkot@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #12833: Cannot cancel query or terminate backend if it client is SIGSTOPed
Date: Thu, 05 Mar 2015 12:33:22 -0500
Message-ID: <26913.1425576802@sss.pgh.pa.us> (raw)
In-Reply-To: <20150305163708.2544.54177@wrigleys.postgresql.org>
References: <20150305163708.2544.54177@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

eshkinkot@gmail.com writes:
> I run this command in bash:
> $ ../bin/psql -X -At -c 'copy (select * from generate_series(1, 100000000))
> to stdout' & ( sleep 2; kill -STOP $!; )

> $ ps f --ppid $$
>   PID TTY      STAT   TIME COMMAND
> 24773 pts/23   R+     0:00 ps f --ppid 5021
> 24685 pts/23   T      0:00 ../bin/psql -X -At -c copy (select * from
> generate_series(1, 100000000)) to stdout

> Now psql is stopped and I try to cancel it backend with
> pg_cancel_backend and pg_terminate_backend, but it not canceled or stopped.

[ shrug... ] It'll probably terminate the query whenever the kernel
returns from send().  There aren't a lot of options here: the only
way we could get out of this without waiting for the client is a
catastrophic termination of the session, which is not really what
either of those operations authorizes.  There's no way to do anything
less drastic without breaking protocol sync.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (3+ messages)  latest in thread

Message-ID: <26913.1425576802@sss.pgh.pa.us>
Permalink:  ../26913.1425576802@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26913.1425576802@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, eshkinkot@gmail.com
  Subject: Re: BUG #12833: Cannot cancel query or terminate backend if it client is SIGSTOPed
  In-Reply-To: <26913.1425576802@sss.pgh.pa.us>
  References: <20150305163708.2544.54177@wrigleys.postgresql.org> <26913.1425576802@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox