Re: Re: [HACKERS] PoC: custom signal handler for extensions

From: David Steele <david(at)pgmasters(dot)net>
To: Arthur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru>, Maksim Milyutin <milyutinma(at)gmail(dot)com>
Cc: Teodor Sigaev <teodor(at)sigaev(dot)ru>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [HACKERS] PoC: custom signal handler for extensions
Date: 2018-03-05 15:50:44
Message-ID: 3a208098-b8a5-5010-d2a0-b2c944ba1c54@pgmasters.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello Maksim,

On 1/27/18 2:19 PM, Arthur Zakirov wrote:
> On Mon, Jan 22, 2018 at 02:34:58PM +0300, Maksim Milyutin wrote:
>
> The patch is applied and build.
>
>> +/*
>> + * UnregisterCustomProcSignal
>> + * Release slot of specific custom signal.
>> + *
>> + * This function have to be called in _PG_init or _PG_fini functions of
>> + * extensions at the stage of loading shared preloaded libraries. Otherwise it
>> + * throws fatal error. Also it throws fatal error if argument is not valid
>> + * custom signal.
>> + */
>> +void
>> +UnregisterCustomProcSignal(ProcSignalReason reason)
>> +{
>> + if (!process_shared_preload_libraries_in_progress)
>> + ereport(FATAL, (errcode(ERRCODE_INTERNAL_ERROR),
>> + errmsg("cannot unregister custom signal after startup")));
>
> Is there actual need in UnregisterCustomProcSignal() within _PG_init()?
> An extension registers a handler and then unregister it doing
> nothing. It seems useless.
>
> Also process_shared_preload_libraries_in_progress within _PG_fini() will
> be false I think. _PG_fini() won't be called though, because
> implementation of internal_unload_library() is disabled.
>
> Actually, is there need in UnregisterCustomProcSignal() at all? It
> unregisters a handler only in current backend, for actual unergistering
> we need to call it everywhere, if I'm not mistaken.

This patch has been in Waiting on Author state for almost three weeks.
Have you had a chance to consider Arthur's suggestions?

Do you know when you'll have an updated patch available?

Thanks,
--
-David
david(at)pgmasters(dot)net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Euler Taveira 2018-03-05 15:56:02 Re: Too much memory allocated for ReorderBufferDiskChange
Previous Message Vik Fearing 2018-03-05 15:48:38 Re: PATCH: psql tab completion for SELECT