Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YTZeN-0006C8-6E for pgsql-bugs@arkaria.postgresql.org; Thu, 05 Mar 2015 17:33:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YTZeL-0008H4-PR for pgsql-bugs@arkaria.postgresql.org; Thu, 05 Mar 2015 17:33:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YTZeL-0008Gv-5q for pgsql-bugs@postgresql.org; Thu, 05 Mar 2015 17:33:29 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YTZeI-0003FR-2d for pgsql-bugs@postgresql.org; Thu, 05 Mar 2015 17:33:28 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t25HXMpf026914; Thu, 5 Mar 2015 12:33:22 -0500 From: Tom Lane To: eshkinkot@gmail.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #12833: Cannot cancel query or terminate backend if it client is SIGSTOPed In-reply-to: <20150305163708.2544.54177@wrigleys.postgresql.org> References: <20150305163708.2544.54177@wrigleys.postgresql.org> Comments: In-reply-to eshkinkot@gmail.com message dated "Thu, 05 Mar 2015 16:37:08 +0000" Date: Thu, 05 Mar 2015 12:33:22 -0500 Message-ID: <26913.1425576802@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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