Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WALKZ-0005Lq-Jv for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Feb 2014 15:21:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WALKZ-0002zz-2D for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Feb 2014 15:21:03 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WALKX-0002xx-IG for pgsql-hackers@postgresql.org; Mon, 03 Feb 2014 15:21:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WALKV-0000hY-3j for pgsql-hackers@postgresql.org; Mon, 03 Feb 2014 15:21:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s13FKvJ7030854; Mon, 3 Feb 2014 10:20:57 -0500 From: Tom Lane To: Robert Haas cc: Antonin Houska , "pgsql-hackers@postgresql.org" Subject: Re: bgworker crashed or not? In-reply-to: References: <52EBE0E0.8040303@gmail.com> Comments: In-reply-to Robert Haas message dated "Mon, 03 Feb 2014 10:15:14 -0500" Date: Mon, 03 Feb 2014 10:20:57 -0500 Message-ID: <30853.1391440857@sss.pgh.pa.us> X-Pg-Spam-Score: -2.4 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Robert Haas writes: > This is admittedly a weird API, and we've had some discussion of > whether to change it, but I don't know that we've reached any final > conclusion. I'm tempted to propose exactly inverting the current > meaning of exit(0). That is, make it mean "don't restart me, ever, > even if I have a restart interval configured" rather than "restart me > right away, even if I have a restart interval configured". That way, > a background process that wants to run until it accomplishes some task > could be written to exit(1) on error and exit(0) on success, which > seems quite natural. So exit(0) - done, permanently exit(1) - done until restart interval exit(other) - crash and there's no way to obtain the "restart immediately" behavior? I think this is an improvement, but it probably depends on what you think the use-cases are for bgworkers. I can definitely see that there is a need for a bgworker to be just plain done, though. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers