Re: BUG #12833: Cannot cancel query or terminate backend if it client is SIGSTOPed - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #12833: Cannot cancel query or terminate backend if it client is SIGSTOPed
Date
Msg-id 26913.1425576802@sss.pgh.pa.us
Whole thread Raw
In response to BUG #12833: Cannot cancel query or terminate backend if it client is SIGSTOPed  (eshkinkot@gmail.com)
Responses Re: BUG #12833: Cannot cancel query or terminate backend if it client is SIGSTOPed  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-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

pgsql-bugs by date:

Previous
From: eshkinkot@gmail.com
Date:
Subject: BUG #12833: Cannot cancel query or terminate backend if it client is SIGSTOPed
Next
From: Andres Freund
Date:
Subject: Re: BUG #12833: Cannot cancel query or terminate backend if it client is SIGSTOPed