Re: [HACKERS] How to kill a Background worker and Its metadata

2016-06-28 Thread Craig Ringer
On 28 June 2016 at 08:28, Akash Agrawal 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. > >

Re: [HACKERS] How to kill a Background worker and Its metadata

2016-06-28 Thread Akash Agrawal
I am calling proc_exit(1) once the worker encounters SIGTERM signal. I've attached my code here. Here is the link to stackoverflow: http://stackoverflow.com/questions/38058628/how-to-kill-a-background-worker-including-its-metadata-in-postgres On Mon, Jun 27, 2016 at 8:41 PM, Craig Ringer

Re: [HACKERS] How to kill a Background worker and Its metadata

2016-06-28 Thread Akash Agrawal
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

Re: [HACKERS] How to kill a Background worker and Its metadata

2016-06-27 Thread Craig Ringer
On 28 June 2016 at 02:27, Akash Agrawal wrote: > Hi, > > I've created a background worker and I am using Postgresql-9.4. This > bgworker handles the job queue dynamically and goes to sleep if there is no > job to process within the next 1 hour. > > Now, I want to have a

Re: [HACKERS] How to kill a Background worker and Its metadata

2016-06-27 Thread Michael Paquier
On Tue, Jun 28, 2016 at 3:27 AM, Akash Agrawal wrote: > I've created a background worker and I am using Postgresql-9.4. This > bgworker handles the job queue dynamically and goes to sleep if there is no > job to process within the next 1 hour. > > Now, I want to have a