From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: dastapov@gmail.com
Subject: BUG #17698: On SIGTERM, psql terminates, but leaves the statement running
Date: Fri, 25 Nov 2022 18:01:40 +0000
Message-ID: <17698-58a6ab8caec496b0@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 17698
Logged by: Dmitry Astapov
Email address: dastapov@gmail.com
PostgreSQL version: 14.2
Operating system: CentOS 7
Description:
Reproduction: start psql, launch a query that will take a while (I used
'select pg_sleep(1234)'), then from another terminal do "kill -TERM <pid of
psql>".
Psql would be terminated, but query would not be, and will keep running
until TCP timeout kicks in and kills the stale connection.
SIGINT, on the other hand, will cause psql will terminate the current
statement.
Perhaps psql could have a SIGTERM handler that does roughly what SIGINT
handler does before terminating the whole process, and would cancel the
current statement (if any)?
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, dastapov@gmail.com
Subject: Re: BUG #17698: On SIGTERM, psql terminates, but leaves the statement running
In-Reply-To: <17698-58a6ab8caec496b0@postgresql.org>
* 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