Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YTZhg-0006Lh-9v for pgsql-bugs@arkaria.postgresql.org; Thu, 05 Mar 2015 17:36:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YTZhf-0000rE-Px for pgsql-bugs@arkaria.postgresql.org; Thu, 05 Mar 2015 17:36:55 +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 1YTZhe-0000r7-SW for pgsql-bugs@postgresql.org; Thu, 05 Mar 2015 17:36:54 +0000 Received: from mout.kundenserver.de ([212.227.126.187]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YTZha-0003Lg-Cx for pgsql-bugs@postgresql.org; Thu, 05 Mar 2015 17:36:53 +0000 Received: from anarazel.de ([93.220.87.244]) by mrelayeu.kundenserver.de (mreue002) with ESMTPSA (Nemesis) id 0LcKBC-1Xn7fO0JDq-00jn1o; Thu, 05 Mar 2015 18:36:44 +0100 Received: by anarazel.de (Postfix, from userid 1000) id C2D71100332; Thu, 5 Mar 2015 18:36:42 +0100 (CET) Date: Thu, 5 Mar 2015 18:36:42 +0100 From: Andres Freund To: Tom Lane Cc: eshkinkot@gmail.com, pgsql-bugs@postgresql.org Subject: Re: BUG #12833: Cannot cancel query or terminate backend if it client is SIGSTOPed Message-ID: <20150305173642.GT30405@awork2.anarazel.de> References: <20150305163708.2544.54177@wrigleys.postgresql.org> <26913.1425576802@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <26913.1425576802@sss.pgh.pa.us> X-Provags-ID: V03:K0:EVFlnTpvHKUj5AFiPhprTMsr7aV1wMIgn+ryEnO6IVcHGjPe9Ry UNakxbodjdp7gbKo2oNMiiN0SEH4dpR/9q2MNFs/E7etB8C6o4C0PNEo7BKrh0/JI2C2Amq rgh/lWD7DOG88J58STkovJdcuasILnOHGE7zCb7r8Iw65NuvIHO+21NV9I9tcVbhgeTToUk UtvUbCQcdhbHjFmAr1eLA== X-UI-Out-Filterresults: notjunk:1; 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 On 2015-03-05 12:33:22 -0500, Tom Lane wrote: > 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. 9.5 should allow sessions to be terminated, but not cancelled. Unfortunately this is too big a change to be backported, so you'll have to wait for that. > [ 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. Well, terminate pretty much authorizes it, no? At least thats what we decided in the "Escaping from blocked send() reprised." thread. If we were blocked in a send() and asked to die we'll now do so. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs