Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WdCNz-000158-TK for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Apr 2014 05:39:52 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WdCNz-0004Dy-8P for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Apr 2014 05:39:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WdCNw-0004Dn-ME for pgsql-hackers@postgresql.org; Thu, 24 Apr 2014 05:39:48 +0000 Received: from moutng.kundenserver.de ([212.227.126.130]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WdCNo-0002UC-Va for pgsql-hackers@postgresql.org; Thu, 24 Apr 2014 05:39:48 +0000 Received: from ayaki.localdomain (106-69-142-119.dyn.iinet.net.au [106.69.142.119]) by mrelayeu.kundenserver.de (node=mreue006) with ESMTP (Nemesis) id 0MQYci-1WTLZo2GPk-00TkHM; Thu, 24 Apr 2014 07:39:35 +0200 Message-ID: <5358A38F.50808@2ndquadrant.com> Date: Thu, 24 Apr 2014 13:39:27 +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" , Abhijit Menon-Sen 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> <534F21E6.7080705@2ndquadrant.com> In-Reply-To: <534F21E6.7080705@2ndquadrant.com> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:vRJdRi4goGBGSUykvCvAvcSyJUrtEXlgeNnL308B2YT UuqMruEv9xcbmozZRDv+739n/f7VEVMpjFBv5AhZDxoFhlPMZR oxcUN4MumEDBXw0R7b+ZiHFHzI7rcpfh1Pfe6uLOus+GKgMX7k aF/zQ+YpgAdf19Tvhnl4zUJpXhFpmKR4J8HyDWOK9UmS/soSsS e3c/FQiMG09tqSE9Nz3A0dalglg2cp+goa+XxNosgrMXI0N3JX cVr5cnDtjfNtbQYDImOXp4iFPriIij+9XXFfYwYARAaJ9RndTB uXjAD+dvEwnkoo+uz31GdKYsDvaN4cUcoV5eEKrHxyfWAGy64I RiNuy9LIgX1lILD+DWFKpwNge7VLM3LshnV6XZPvp 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 08:35 AM, Craig Ringer wrote: > 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. I'm now strongly in favour of this alternative. I've just noticed that the bgworker control interfaces do not honour bgw.bgw_restart_time = BGW_NEVER_RESTART if you exit with status zero. This means that it's not simply a problem where you can't say "restart me if I crash, but not if I exit normally". You also can't even say "never restart me at all". Because "BGW_NEVER_RESTART" seems to really mean "BGW_NO_RESTART_ON_CRASH". This _needs_fixing before 9.4. -- 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