Re: Considering signal handling in plpython again

Поиск
Список
Период
Сортировка
От Hubert Zhang
Тема Re: Considering signal handling in plpython again
Дата
Msg-id CAB0yrenas-CW8Nif9Zu+w4tv9oAZ3_unKL_Ye6JVJcqs0gtYQg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Considering signal handling in plpython again  (Heikki Linnakangas <hlinnaka@iki.fi>)
Ответы Re: Considering signal handling in plpython again  (Heikki Linnakangas <hlinnaka@iki.fi>)
Список pgsql-hackers
There are remaining two problems

1. Do we need to consider when to delete the extension hook or it's not necessary?
    As the destroy function _PG_fini doesn't work, I cannot find a good place to reset to hook gracefully.
    I tested the drop language plpythonu statement which will not remove the python shared library in the current session,
    So it seems to be safe to leave the cancel_handler_hook not be reset.
    How about other extensions, for example plr. Does the "drop extension" statement will not remove the loaded shared library in the process either?
    
    -- Another idea is to register the hook at the beginning of plpython_call_handler and unregister the hook at the end of plpython_call_handler.

2. Do we need to use explicit hook list(List *cancel_hook_list) instead of implicit cancel_hook(which relies on the extension to link the cancel_hook inside their code 
     e.g. prev_hook = cancel_hook; cancel_hook=my_hook;   void my_hook(){mywork(); (*prev_hook)();} )?
    I didn't find any explicit hook list in PG code base, is that a good practice?

-- Hubert


On Mon, May 14, 2018 at 6:40 PM, Heikki Linnakangas <hlinnaka@iki.fi> wrote:
On 14/05/18 10:56, Hubert Zhang wrote:
For nested SPI case, one option is to turn off the bool variable when
entering the SPI function(PLy_spi_prepare, PLy_spi_execute, PLy_cursor etc.)
and turn on the bool variable again when exiting the SPI function.

Yeah, that seems reasonable.

- Heikki



--
Thanks

Hubert Zhang

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

Предыдущее
От: Ashutosh Bapat
Дата:
Сообщение: Re: Expression errors with "FOR UPDATE" and postgres_fdw withpartition wise join enabled.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [BUGFIX] amcanbackward is not checked before building backward index paths