Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w7mVf-005gbx-2O for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Apr 2026 03:44:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w7mVe-00EaAr-0p for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Apr 2026 03:44:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w7mVd-00EaAi-39 for pgsql-hackers@lists.postgresql.org; Wed, 01 Apr 2026 03:44:50 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w7mVb-00000002Hun-14cV for pgsql-hackers@lists.postgresql.org; Wed, 01 Apr 2026 03:44:49 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4853c1ca73aso65676245e9.2 for ; Tue, 31 Mar 2026 20:44:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775015086; x=1775619886; darn=lists.postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=53S0Q6ziyZmH1XB1SS/xrXwilY2fM1cRUFYpPze4lks=; b=dpAn7f2JfC434/r15jhsnKWJWwH3r19s3ynTl0PJEHvec7tLK4/qa0ILbDpaKBUR3a uggTCwQnleSU+jDz+WgZVN920FWVFo3/gap51BLFBe46z/Q93whuPnsTOLJTpOy48Ozw wkNNyy53xAyjDymeZz63yu+MzihjYon+b1KQCecX5CWdYi6Iodg2UBijHloIJNEkoZPR iOXzghtb9Gt609He1/TLw7oVnp5avvu/iLY9XAlaZHSmD7SH5ZuX3EPtyhKKs7JriyBn iBMXdjTmxwY8RS8+7yRp76XjvjhwQ9qbYTItxiqxaIhIuEtwN1VirDKHEv77x71GkE3x EW7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775015086; x=1775619886; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=53S0Q6ziyZmH1XB1SS/xrXwilY2fM1cRUFYpPze4lks=; b=DvGLiHZAfrhMNsgLYkWLuKXEGqVmC1roGiam6wXRWoCO/dq8xljOXTOECL/njTIdWy 8trNOVmc+/ewBzUXq1s1okoaI3o1AlPLLUPnTGoSnFNnq3UkjEFocZS5eXdfpDs/Y25D +fg+sw0NBaMzXIZsrE7eUJ0Xc0SzF7ofd44MUpKK1uyB/TEs+LgynQ95PVyx5iq7XiHc +dIMN26vl5NM6nhxZMAm/LwkbToSMYnFV5D6EzAI9oM/0JDdKt/rPXB0XjyrNfsz+c+f zYPOfJOi+Nmkxvn4EWMdn1vtHxdwy4u7/E7TGFStKtxbJxWUfCgpBWx5tdB+k7rie/OR ym9g== X-Forwarded-Encrypted: i=1; AJvYcCURDnfzjGcjeiCos5LwYXysuMxk15AUgt0DugnR6jew/kyNXquV7aKWmR47pbOfB8yL50eYxh8YZcVf+g25@lists.postgresql.org X-Gm-Message-State: AOJu0Yx9qz4Uha/q4nW8M9VwMsZJRkulJJjbJt792jp2rQWsIFDrQqY4 w+dz4VkWruEN0rrcFHqm54DbS9vLflUXK0+gRxF24hdzx61GiUokpAaA X-Gm-Gg: ATEYQzwbrgQol47tVRso4hEX4vI9ZadS+VBm58NXLwA/abL6ojTUm1U6R08nlyrht7w q1amB2B2/p+iQI36EiOdBzXKb/n+JUNHipfe6i4a3VWWVOJlher1d8Q/4qxAwKwUYkGcZQMEEUN t3bAnydaomu/7tftFKqPuVKx7ELd70pIIkLPM3DZO2KSnk9d+40F2lExIoUx/4FU5SN1xQW59Qi qGDqNjU1NBmb+E/VRAlApe7ZIp3G5IjOiWDlH+YTPFXFIf9vK1OLxdInqwlOE9MXL1pswaaNEJW EQt8uHhQU88Xiczivi9pMZeYuiZVjuu4eqSqjocbyVvZGPsK5n0Zz1J76y468f+E5vwoxcd4R3U QRBb6l+FI/IJIfFy4t7dRlo9MjXoVrVP8dfYTAxeE/05cT/m+nS6aFV5HZGfRw8PYiS88SSPz0N CwnZIw7MtxnBfK3dFYfobI4dXTLQbbqaeapitYFnXSXDbHoRn5Y3OiNV74miMFn8j8NArMF/34E hZ11WiFvbg9ExjeSdso9RQ0X3Hgf09rwjaJY3SV7R51xATKw2/NnaOaSA== X-Received: by 2002:a05:600c:a4c:b0:487:1c2:6a56 with SMTP id 5b1f17b1804b1-4888356844bmr29429225e9.3.1775015085965; Tue, 31 Mar 2026 20:44:45 -0700 (PDT) Received: from ip-10-97-1-34.eu-west-3.compute.internal (ec2-15-237-197-144.eu-west-3.compute.amazonaws.com. [15.237.197.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4887c884c10sm30891565e9.19.2026.03.31.20.44.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Mar 2026 20:44:45 -0700 (PDT) Date: Wed, 1 Apr 2026 03:44:44 +0000 From: Bertrand Drouvot To: Fujii Masao Cc: Dilip Kumar , Chao Li , Bharath Rupireddy , PostgreSQL Hackers Subject: Re: Avoid multiple SetLatch() calls in procsignal_sigusr1_handler() Message-ID: References: <29CA73B2-872A-4D7D-B8E9-D89F76DC18AF@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Wed, Apr 01, 2026 at 12:17:28PM +0900, Fujii Masao wrote: > On Mon, Mar 30, 2026 at 1:21 PM Dilip Kumar wrote: > > Shouldn't we add a comment to the handler function header stating that > > SetLatch should be called by the caller? procsignal_sigusr1_handler() > > is currently the only caller and handles it, but this would ensure any > > future callers are responsible for the same. > > I *guess* the original comment was added because readers of the interrupt > handling code might just wonder why SetLatch() isn't called. If so, it makes > sense to keep that explanation in the handler functions themselves. > > The existing comment seems sufficient to me. The code isn't complicated enough > to require more comment for future use of functions in advance, and we can > revisit it if the functions change in the future. Based on this, I'm thinking > to commit v2 patch. That sounds reasonable to me to proceed as v2 is doing. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com