Re: [HACKERS] Optional message to user when terminating/cancelling backend - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: [HACKERS] Optional message to user when terminating/cancelling backend
Date
Msg-id 4614BA96-0085-4139-8C18-0552FFF66AF8@yesql.se
Whole thread Raw
In response to Re: [HACKERS] Optional message to user when terminating/cancellingbackend  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: [HACKERS] Optional message to user when terminating/cancelling backend
List pgsql-hackers
> On 24 Jan 2018, at 16:45, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
>
> A quick suggestion from a passer-by -- would you put the new code in
> src/backend/storage/ipc/backend_signal.c instead?  Sounds like a better
> place than utils/misc/; and "signal" is more general in nature than just
> "cancel".  A bunch of stuff from utils/adt/misc.c (???) can migrate to
> the new file -- everything from line 201 to 362 at least, that is:
>
> pg_signal_backend
> pg_cancel_backend
> pg_terminate_backend
> pg_reload_conf
> pg_rotate_logfile

+1, this makes a lot of sense.  When writing this I didn’t find a good fit
anywhere so I modelled it after utils/misc/backend_random.c, not because it was
a good fit but it was the least bad one I could come up with.  This seems a lot
cleaner.

> Maybe have two patches, 0001 creates the files moving the contents over,
> then 0002 adds your new stuff on top.

The two attached patches implements this.

> /me wonders if there's anything that would suggest to make this
> extensive to processes other than backends ...

Perhaps, do you have an API in mind?

cheers ./daniel


Attachment

pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: PATCH: pgbench - option to build using ppoll() for largerconnection counts
Next
From: Daniel Gustafsson
Date:
Subject: Re: [HACKERS] GnuTLS support