Re: BUG #17698: On SIGTERM, psql terminates, but leaves the statement running

From: Dmitry Astapov <dastapov(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17698: On SIGTERM, psql terminates, but leaves the statement running
Date: 2023-01-16 19:44:36
Message-ID: CAFQUnFgYi4+ySU-D4w1v3zeMTsjSymbc5VF+KRvnoRZ01K99-g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Jan 16, 2023 at 3:21 PM Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
wrote:

> On 2022-Nov-25, PG Bug reporting form wrote:
> >
> > 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)?
>
> Sure. I doubt we want to wait until a reply to the cancel request is
> obtained, but we could have the sigterm handler at least send it before
> terminating.
>
> Why do you send SIGTERM to psql anyway?
>
>
The way the story was told to me by the user, they started psql from inside
the neovim session and then cancelled it with Ctrl-C. Apparently, neovim
(unlike, say, vim) sends SIGTERM to the child process in this case (whereas
vim will send SIGINT).

--
D. Astapov

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Pavel Stehule 2023-01-16 20:34:51 Re: BUG #17698: On SIGTERM, psql terminates, but leaves the statement running
Previous Message Alvaro Herrera 2023-01-16 15:31:04 Re: BUG #17741: vacuum process hangs after pg_surgery manipulations