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 1wAOuW-002LY0-1i for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Apr 2026 09:09:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wAOuU-006EIG-1E for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Apr 2026 09:09:18 +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 1wAOuU-006EI6-0E for pgsql-hackers@lists.postgresql.org; Wed, 08 Apr 2026 09:09:18 +0000 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wAOuS-00000001Gp5-0pPY for pgsql-hackers@postgresql.org; Wed, 08 Apr 2026 09:09:18 +0000 Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-35c206f0481so5731327a91.0 for ; Wed, 08 Apr 2026 02:09:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775639353; x=1776244153; darn=postgresql.org; h=to:date:message-id:subject:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=ms+4m2S/LifeUHhhyEaCHNqbb2zxMdMR2Mi80Px3ss4=; b=nYd+zhbTPvGIGbkR8JbiJKmSp3wkm/iC9dxvrAqm6Dej348k9TlZCFq0g413403NcE EwOdSsW/e3J7fl1x+2GrBDmrozLlEKa8SZWB9HNg2CBfgd4xNfI7UcaYizQTt2ySPzEM d0O4D0vhqQtjon2woafNHFqpQ9JDmZQf75u/PewIZX92rLYnTk8IyDrVxbLsEO9rpBvi ZB9Ozoa/Fqk3kyOmyMfz2KyFgqbN0AN3/TRfyhcv70UO3zrygMCL0yrdH7RyIqu1HMhl HPAvZUGev8kLn5c2Rt5bvcFKYZmhxiSKfuVe5eL/60PHb2vi5ndiG48pwMTp98WcnldM BXgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775639353; x=1776244153; h=to:date:message-id:subject:mime-version:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ms+4m2S/LifeUHhhyEaCHNqbb2zxMdMR2Mi80Px3ss4=; b=i51VEJQW8K+mrBBbFA7m4l41W5jYePDtfDH4Ks4KWUkaNcyi9/68saOYRXDI2rlmlG JdiHgpfhf4ETKKQb8g/CF4HFN88DnLOdq35gfwmelRGwUu5Zyd+ADIfyZ+gz9Bcr2/wl yZXANgTjNFp70jAoX5qo+QnS69qVdU7/BnZcSdgBQdxvxP7lKqcl0WOx2EnRRUEIvn+g CFH/LRDZlJKGn50oUUooihMvqAMPPRmdXW90mDUoJyQ5WdzEebJqKfptvxSxfoWv2yp+ CHZbtSdxTaYTDYChOaUMLKU3v1dcMX9v/IttykTCVtZdlk3RBEFBnrPFFvS+7o2NFE1n a2rA== X-Gm-Message-State: AOJu0Yz5/ffsQ1IaC6oa8/4Qtu4aYCVTGHq3xb1Yxnwsvw6XpR7oEsFi Skxv3ARt6h95pPKhaDD6MFLBO/wkZkrhcl5WJ3mF0zqqwWRMevwJ7M4A4j3q5G1yb7b4OQ== X-Gm-Gg: AeBDievy0HCSCpOr/1AHpV1DxrRN/Gkwmn1IhvLj2xBpnAIJ5fyOBVtKE0d9s47ae2P LB7MsARv3ac+7zvRWRJkT11rypY1vuMaMYkX/nsrgbMG4VC3ZFw+xNuWjFLyfFIg37aO32Py3fu iSgK0o3yz+2A3yojP27/TCq/89uELnM3Pryej8F7JBN4xgdlDf7N1L33v+gtYb95IBPsOkyj/24 ZhM7rr8GxURDoj55uNYWetsL5SgjrbiCIbRExcHf4bmle4FrZPORFajo7X9mjPO2rNk94FKS1fr MNfGWtfEI5iGqa6WLaJcJPM6H4wGJOfWjR8JsE3SnIXVfEAwyzN9ZUhjsp3dLxp2O0LPW9d1Ym6 UXthCVKjenbgoAbFuuwkcnD4edLVrZZzbBZxL4PLDyju3gGPKW2C8iOEFx0dE9GGa4zMRAzAlo3 jiNt+3WwrGwvplf3fL4Dv7y9BLElMWd6ib X-Received: by 2002:a17:90b:4ccf:b0:35b:e593:b1d7 with SMTP id 98e67ed59e1d1-35de6825f04mr20462692a91.12.1775639353268; Wed, 08 Apr 2026 02:09:13 -0700 (PDT) Received: from smtpclient.apple ([185.135.79.125]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-35e2b214fb0sm978412a91.0.2026.04.08.02.09.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Apr 2026 02:09:11 -0700 (PDT) From: Chao Li Content-Type: multipart/mixed; boundary="Apple-Mail=_5F49386D-B264-4F0F-BCF6-FFC8F4334703" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.400.21\)) Subject: Use proc_exit() in WalRcvWaitForStartPosition Message-Id: <74381238-4E8A-4621-B794-57025DCCE0BA@gmail.com> Date: Wed, 8 Apr 2026 17:08:36 +0800 To: PostgreSQL-development X-Mailer: Apple Mail (2.3864.400.21) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_5F49386D-B264-4F0F-BCF6-FFC8F4334703 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi, While working on another patch, I happened to notice that = WalRcvWaitForStartPosition() calls raw exit(1). I think this should use = proc_exit(1) instead, so that the normal cleanup machinery is not = bypassed. This tiny patch just replaces exit(1) with proc_exit(1) in = WalRcvWaitForStartPosition(). Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/ --Apple-Mail=_5F49386D-B264-4F0F-BCF6-FFC8F4334703 Content-Disposition: attachment; filename=v1-0001-Use-proc_exit-in-WalRcvWaitForStartPosition.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="v1-0001-Use-proc_exit-in-WalRcvWaitForStartPosition.patch" Content-Transfer-Encoding: quoted-printable =46rom=202a05e01c58100349bf4815d82cd0ed6f0efc967f=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20"Chao=20Li=20(Evan)"=20=0A= Date:=20Wed,=208=20Apr=202026=2017:02:28=20+0800=0ASubject:=20[PATCH=20= v1]=20Use=20proc_exit()=20in=20WalRcvWaitForStartPosition=0A=0AAuthor:=20= Chao=20Li=20=0A---=0A=20= src/backend/replication/walreceiver.c=20|=202=20+-=0A=201=20file=20= changed,=201=20insertion(+),=201=20deletion(-)=0A=0Adiff=20--git=20= a/src/backend/replication/walreceiver.c=20= b/src/backend/replication/walreceiver.c=0Aindex=20= 09fde92bfd7..47c238557b2=20100644=0A---=20= a/src/backend/replication/walreceiver.c=0A+++=20= b/src/backend/replication/walreceiver.c=0A@@=20-710,7=20+710,7=20@@=20= WalRcvWaitForStartPosition(XLogRecPtr=20*startpoint,=20TimeLineID=20= *startpointTLI)=0A=20=09=09=09=20*=20to=20die,=20but=20might=20as=20well=20= check=20it=20here=20too.=0A=20=09=09=09=20*/=0A=20=09=09=09= SpinLockRelease(&walrcv->mutex);=0A-=09=09=09exit(1);=0A+=09=09=09= proc_exit(1);=0A=20=09=09}=0A=20=09=09SpinLockRelease(&walrcv->mutex);=0A= =20=0A--=20=0A2.50.1=20(Apple=20Git-155)=0A=0A= --Apple-Mail=_5F49386D-B264-4F0F-BCF6-FFC8F4334703--