Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kaVhE-0006cr-4G for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Nov 2020 03:12:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kaVhC-0005Y1-Sv for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Nov 2020 03:12:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kaVhC-0005Xu-Jp for pgsql-hackers@lists.postgresql.org; Thu, 05 Nov 2020 03:12:18 +0000 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kaVh6-0000yh-BU for pgsql-hackers@postgresql.org; Thu, 05 Nov 2020 03:12:18 +0000 Received: by mail-pf1-x435.google.com with SMTP id c20so225022pfr.8 for ; Wed, 04 Nov 2020 19:12:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:to:cc:subject:from:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=VXyEr8ITagdUsiXzfdomEyUJdnt/k1X6Wido8/gpp3M=; b=QJRHZhkJlJz5SITNuOvHVSc/mnHSOOsJwr8ldFnjVvcc1+1RWbx55fEKHFlB9scMf4 EtBJhBAaZNoU8soeF9D2fVxMPOiK9TUYdM2AH4ypisYP1E3xQUsm9KMMF+32LneOSn/A V7FPgBvn6esho5Aswzhi/c0MQMyQytrlRdQBuDJG5nzouhwGwoaY8YU73OyFwo/M2z2j vC+8C/X3o1oa62j31Nx1xorQODnLtykWrBYhm4xZ8Cd0OlK+YhZL78vhg9MuNNX0J4T7 9wdHvypDVQKqrfcRkr3GEyCE+XI1JgyX/F2AcluDzTllRQUK2uCehL1VXe6btGfdIxFa nZqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:to:cc:subject:from:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=VXyEr8ITagdUsiXzfdomEyUJdnt/k1X6Wido8/gpp3M=; b=YjbYTpmuAM1T4PganVwPfC2hHXD8qXf1GgUzUHbFG4JxSJEcSKt9NvXtf02WVZgwb6 7YYakCi37WsJohENy0g649jr7T9fcoO6Q9VS2TQUDM3wpa2a/Zf4fTqZg69UZA0ZdplY ZjuofbO0Wn7VzvGvfAkMsnn+9bZwDCWhvNSvDL4G+zasZvWzmyqH4KvA0iscqfodyCz+ Nao/hovaI3nC7gxYG/VHgrL+loE7FxMUaGboQEL7QkHsrDDst+vn8afyIv29z4pgSOOQ P/5a5q10rcrLAX0UsFzCNwLJ7xUKwQL8Ea3Tct8/3Ud7m8qRe/aLjdK7CdsJa2WTNbqc k9xg== X-Gm-Message-State: AOAM532tS+mYN6Dmx6iJNVDNsm8sF/Carb4HaWtSVMDmcatNSXx37t16 FYIwicUxlT7gdu4FTAdUsNU= X-Google-Smtp-Source: ABdhPJyJzbxZdg3RwdfUTsjCFi1Kjuth6mOGncE2jCYxaEeLSdLI2h/DcAauX18jlQ4QJtRn0E4WnA== X-Received: by 2002:a17:90b:345:: with SMTP id fh5mr298201pjb.198.1604545929367; Wed, 04 Nov 2020 19:12:09 -0800 (PST) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id nh4sm141809pjb.1.2020.11.04.19.12.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Nov 2020 19:12:08 -0800 (PST) Date: Thu, 05 Nov 2020 12:12:06 +0900 (JST) Message-Id: <20201105.121206.819769369617763972.horikyota.ntt@gmail.com> To: bharath.rupireddyforpostgres@gmail.com Cc: masao.fujii@oss.nttdata.com, pgsql-hackers@postgresql.org Subject: Re: Use standard SIGHUP and SIGTERM handlers in autoprewarm module From: Kyotaro Horiguchi In-Reply-To: References: <6b561c73-27ce-7079-b6e5-440e49653810@oss.nttdata.com> User-Agent: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk At Wed, 4 Nov 2020 21:16:29 +0530, Bharath Rupireddy wrote in > On Wed, Nov 4, 2020 at 2:36 PM Fujii Masao wrote: > > > > Regarding other two patches, I think that it's better to use MyLatch > > rather than MyProc->procLatch or walrcv->latch in WaitLatch() and > > ResetLatch(), like other code does. Attached are the updated versions > > of the patches. Thought? > > > > +1 for replacing MyProc->procLatch with MyLatch in the autoprewarm > module, and the patch looks good to me. Looks good to me, too. > I'm not quite sure to replace all the places in the walreceiver > process, for instance in WalRcvForceReply() we are using spinlock to > acquire the latch pointer and . Others may have better thoughts on > this. The SIGTERM part looks good. The only difference between WalRcvSigHupHandler and SignalHandlerForConfigReload is whether latch is set or not. I don't think it's a problem that config-reload causes an extra wakeup. Couldn't we do the same thing for SIGHUP? We might even be able to reload config file in ProcessWalRcvInterrupts(). regards. -- Kyotaro Horiguchi NTT Open Source Software Center