Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZKGQt-000099-Jf for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Jul 2015 01:45:23 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZKGQs-00024m-RR for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Jul 2015 01:45:22 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZKGQr-000240-DM for pgsql-hackers@postgresql.org; Wed, 29 Jul 2015 01:45:21 +0000 Received: from smtp2.scorpionshops.com ([82.118.24.230] helo=kilimanjaro.scorpionshops.com) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZKGQi-0007Ls-9b for pgsql-hackers@postgresql.org; Wed, 29 Jul 2015 01:45:20 +0000 Received: from [192.168.1.4] (92-32-205-89.tn.glocalnet.net [92.32.205.89]) by kilimanjaro.scorpionshops.com (Postfix) with ESMTPSA id 482407BC09B; Wed, 29 Jul 2015 03:45:09 +0200 (CEST) Message-ID: <55B83024.10804@proxel.se> Date: Wed, 29 Jul 2015 03:45:08 +0200 From: Andreas Karlsson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: Michael Paquier CC: Peter Eisentraut , PostgreSQL-development Subject: Re: [PATCH] Reload SSL certificates on SIGHUP References: <556A6E8A.9030400@proxel.se> <55956342.9050408@gmx.net> <55AEE95E.7090304@proxel.se> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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 07/23/2015 07:19 AM, Michael Paquier wrote: > On Wed, Jul 22, 2015 at 9:52 AM, Andreas Karlsson wrote: >> On 07/02/2015 06:13 PM, Peter Eisentraut wrote: >>> >>> I think this would be a useful feature, and the implementation looks >>> sound. But I don't like how the reload is organized. Reinitializing >>> the context in the sighup handler, aside from questions about how much >>> work one should do in a signal handler, would cause SSL reinitialization >>> for unrelated reloads. We have the GUC assign hook mechanism for >>> handling this sort of thing. The trick would be that when multiple >>> SSL-related settings change, you only want to do one reinitialization. >>> You could either have the different assign hooks communicate with each >>> other somehow, or have them set a "need SSL init" flag that is checked >>> somewhere else. >> >> >> It is not enough to just add a hook to the GUCs since I would guess most >> users would expect the certificate to be reloaded if just the file has been >> replaced and no GUC was changed. > > Why? It seems to me that the assign hook gets called once per process > at reload for a SIGHUP parameter even if its value is not changed, no? My bad, I tested it and you are correct. But I am not convinced moving the SSL initialization to a GUC assign hook would make anything clearer. It would not move any work out of the signal handler either since the assign hooks are ran inside it, and the hook will be ran in all backends which is not any interesting property for SSL initialization. Andreas -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers