Re: How to kill a Background worker and Its metadata
От | Craig Ringer |
---|---|
Тема | Re: How to kill a Background worker and Its metadata |
Дата | |
Msg-id | CAMsr+YG-fD+mP-BNZDheVYucC7=oUn8ByTQSFz7RKkVX2MRS2Q@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: How to kill a Background worker and Its metadata (Akash Agrawal <aagrawa6@ncsu.edu>) |
Список | pgsql-hackers |
On 28 June 2016 at 08:28, Akash Agrawal <aagrawa6@ncsu.edu> wrote:
I've handled SIGTERM signal.pg_terminate_backend
send signals (SIGTERM) to backend processes identified by process ID. And also, after this call I am able to track in my logs that the background worker gets terminated.Yet, I am only able to register first 8 background workers. I am using select worker_spi1_launch(1) to launch it every time. This is why I guess there is some metadata maintained which has got to be deleted.
(Please reply below other posts, not above)
* proc_exit(0) from within the worker; or
* register it with BGW_NO_RESTART so it doesn't auto-restart in the first place.
This is a deficiency in the bgworker API, but there are workarounds in place and other things are more important for now. Just make your your workers proc_exit(0) on SIGTERM or don't register them as auto-restarting.
В списке pgsql-hackers по дате отправления: