Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WaaJC-0004Xh-Rg for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Apr 2014 00:36:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WaaJC-0006O7-4B for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Apr 2014 00:36:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WaaJ9-0006Ja-25 for pgsql-hackers@postgresql.org; Thu, 17 Apr 2014 00:36:03 +0000 Received: from moutng.kundenserver.de ([212.227.17.13]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WaaJ6-00083s-B5 for pgsql-hackers@postgresql.org; Thu, 17 Apr 2014 00:36:02 +0000 Received: from ayaki.localdomain (58-7-116-194.dyn.iinet.net.au [58.7.116.194]) by mrelayeu.kundenserver.de (node=mreue102) with ESMTP (Nemesis) id 0MEmVu-1Wl1l23kRG-00G4Z9; Thu, 17 Apr 2014 02:35:57 +0200 Message-ID: <534F21E6.7080705@2ndquadrant.com> Date: Thu, 17 Apr 2014 08:35:50 +0800 From: Craig Ringer Organization: 2nd Quadrant User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Petr Jelinek , Robert Haas , Andres Freund CC: Tom Lane , Antonin Houska , "pgsql-hackers@postgresql.org" Subject: Re: bgworker crashed or not? References: <20140416131052.GG17874@awork2.anarazel.de> <20140416152803.GJ17874@awork2.anarazel.de> <20140416154412.GL17874@awork2.anarazel.de> <27214.1397663665@sss.pgh.pa.us> <20140416160047.GM17874@awork2.anarazel.de> <20140416161143.GN17874@awork2.anarazel.de> <20140416162837.GO17874@awork2.anarazel.de> <534EEC61.7000006@2ndquadrant.com> In-Reply-To: <534EEC61.7000006@2ndquadrant.com> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:ufA+hjoAz2XyHw5L9JJ5sEIWIpRb8prMl1sBTGswGgy k0ymBxPsKdHOeHEXQ4oJIfzBq8QSX2z9j9+EgqPf0dJu5l1CMu 5+UBxcEIqaO54hzpOTHGM2pk10ez5MfXcjjmA9+d8TEVhxyLUD pwRwvpwkdPNowGs7iQ0Dvc8yUsFLhSdLbCNqfvzo4dnjCtNni4 Fxdzj4IxDoZJfTcOEaCpO6F3Cj5aLK8dDdqHJl1rmEPHicphMf EvOBzSdP/EdtUU4EIQXL06BZ2xeo9kIyAVaY+Gs/T7hu1vf2Lu d3A471uQcmVX6tnUENBk/12kMNLFQhz4GOBzA0//5+gE3vgu1z xCqoZKogLuGkNMCWVE8r8OEvkS6DKrr3sGOUqiQm2 X-Pg-Spam-Score: -1.9 (-) 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 On 04/17/2014 04:47 AM, Petr Jelinek wrote: > > Well the logging is just too spammy in general when it comes to dynamic > bgworkers but that's easy to fix in the future, no need to make > decisions for 9.4. Agreed - it's the *API* that we need sorted out for 9.4, and log output isn't something Pg tends to consider part of the API. > However I really don't like that I have to exit with exit code 1, which > is normally used as failure, if I want to shutdown my dynamic bgworker > once it has finished the work. And this behavior is something we can set > properly only once... As far as I can tell we have a couple of options: - Redefine what the exit codes mean so that exit 0 suppresses auto-restart and exits silently. Probably simplest. or - Expose a worker's BackgroundWorkerHandle as a global within the worker, and let it TerminateBackroundWorker(my_bgw_handle) its self. Of those, just changing the meaning of the exit code seems simpler and easier. It's not clear to me why it appears to be contentious. I don't think the status quo, with no way to exit a dynamic bgworker w/o an error, is OK. It's like those delightful "Error: Success" messages one gets when using perror() inappropriately - deeply confusing to users. Lets try not to be stuck with that when we can avoid it. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers