Re: [HACKERS] Optional message to user when terminating/cancelling backend
Daniel Gustafsson <daniel@yesql.se>
From: Daniel Gustafsson <daniel@yesql.se>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Thomas Munro <thomas.munro@enterprisedb.com>,
Andres Freund <andres@anarazel.de>,
Onder Kalaci <onder@citusdata.com>,
PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Date: 2018-08-27T10:06:18Z
Lists: pgsql-hackers
Attachments
- 0001-Refactor-backend-signalling-code-v15.patch (application/octet-stream) patch v15-0001
- 0002-Support-optional-message-in-backend-cancel-terminate-v15.patch (application/octet-stream) patch v15-0002
> On 24 Aug 2018, at 03:37, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Thomas Munro <thomas.munro@enterprisedb.com> writes:
>> On Fri, Aug 24, 2018 at 6:53 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> I think this is just a timing problem: the signal gets sent,
>>> but it might or might not get received before the current statement ends.
>
>> How about we just wait forever if the function manages to return?
>> select case when pg_cancel_backend(pg_backend_pid(), '...') then
>> pg_sleep('infinity') end;
>
> Hm, that might work. I'd pick a long but not infinite timeout --- maybe
> 60 sec would be good.
I like that idea, so I’ve updated the patch to see what the cfbot thinks of it.
cheers ./daniel
Commits
-
Refactor user-facing SQL functions signalling backends
- 09921f397b84 12.0 landed
-
Introduce 64-bit hash functions with a 64-bit seed.
- 81c5e46c490e 11.0 cited