Re: [HACKERS] background worker and normal exit

2013-05-28 Thread Robert Haas
On Sun, May 26, 2013 at 6:48 PM, Michael Paquier michael.paqu...@gmail.com wrote: Hmm so you can't have workers just doing something once and exit? I have to admit, i didn't follow bgworkers closely in the past, but could you give a short insight on why this is currently not possible?

Re: [HACKERS] background worker and normal exit

2013-05-28 Thread Andres Freund
On 2013-05-28 10:23:46 -0400, Robert Haas wrote: On Sun, May 26, 2013 at 6:48 PM, Michael Paquier - set bgw_restart_time to BGW_NEVER_RESTART. and have the bgworler exit with non-0 status code. That might be good enough, though. I suggested that to Fujii at pgcon, and it seems to work for

Re: [HACKERS] background worker and normal exit

2013-05-28 Thread Robert Haas
On Tue, May 28, 2013 at 10:31 AM, Andres Freund and...@2ndquadrant.com wrote: On 2013-05-28 10:23:46 -0400, Robert Haas wrote: On Sun, May 26, 2013 at 6:48 PM, Michael Paquier - set bgw_restart_time to BGW_NEVER_RESTART. and have the bgworler exit with non-0 status code. That might be

Re: [HACKERS] background worker and normal exit

2013-05-28 Thread Andres Freund
On 2013-05-28 10:33:47 -0400, Robert Haas wrote: On Tue, May 28, 2013 at 10:31 AM, Andres Freund and...@2ndquadrant.com wrote: On 2013-05-28 10:23:46 -0400, Robert Haas wrote: On Sun, May 26, 2013 at 6:48 PM, Michael Paquier - set bgw_restart_time to BGW_NEVER_RESTART. and have the

Re: [HACKERS] background worker and normal exit

2013-05-26 Thread Bernd Helmle
--On 26. Mai 2013 11:38:55 +0900 Michael Paquier michael.paqu...@gmail.com wrote: This flag makes a worker not to restart only in case of a crash. To solve your problem, you could as well allow your process to restart and put it in indefinite sleep if server is not in recovery such it it

Re: [HACKERS] background worker and normal exit

2013-05-26 Thread Michael Paquier
On Mon, May 27, 2013 at 2:04 AM, Bernd Helmle maili...@oopsware.de wrote: --On 26. Mai 2013 11:38:55 +0900 Michael Paquier michael.paqu...@gmail.com wrote: This flag makes a worker not to restart only in case of a crash. To solve your problem, you could as well allow your process to

[HACKERS] background worker and normal exit

2013-05-25 Thread Fujii Masao
Hi, I found that the normal exit (i.e., with exit code 0) of bgworker always leads to the immediate restart of bgworker whatever bgw_restart_time is. Is this intentional? Not only crash but also normal exit should go along with bgw_restart_time? I'm now writing the bgworker which is allowed to

Re: [HACKERS] background worker and normal exit

2013-05-25 Thread Michael Paquier
On Sun, May 26, 2013 at 6:16 AM, Fujii Masao masao.fu...@gmail.com wrote: I found that the normal exit (i.e., with exit code 0) of bgworker always leads to the immediate restart of bgworker whatever bgw_restart_time is. Is this intentional? Yes, per the docs: