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

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: BUG #17698: On SIGTERM, psql terminates, but leaves the statement running
Дата
Msg-id CAFj8pRD86XAkb8kw5mF5Z6Jvv8ygVkmyNouFq+0T=mOUgFGm=g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #17698: On SIGTERM, psql terminates, but leaves the statement running  (Dmitry Astapov <dastapov@gmail.com>)
Список pgsql-bugs


po 16. 1. 2023 v 20:45 odesílatel Dmitry Astapov <dastapov@gmail.com> napsal:


On Mon, Jan 16, 2023 at 3:21 PM Alvaro Herrera <alvherre@alvh.no-ip.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).

I think there may be a bug - I am not able to reproduce it, but sometimes I can crash psql by CTRL-C too.

Regards

Pavel


 


--
D. Astapov

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Dmitry Astapov
Дата:
Сообщение: Re: BUG #17698: On SIGTERM, psql terminates, but leaves the statement running
Следующее
От: Mats Kindahl
Дата:
Сообщение: Re: Crash during backend start when low on memory