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 1wOiNN-0006fi-2n for pgsql-hackers@arkaria.postgresql.org; Sun, 17 May 2026 20:46:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wOiNL-000TNM-0z for pgsql-hackers@arkaria.postgresql.org; Sun, 17 May 2026 20:46:16 +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 1wOiNK-000TNE-39 for pgsql-hackers@lists.postgresql.org; Sun, 17 May 2026 20:46:15 +0000 Received: from fout-a4-smtp.messagingengine.com ([103.168.172.147]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wOiNJ-000000004Zz-1Rcw for pgsql-hackers@lists.postgresql.org; Sun, 17 May 2026 20:46:15 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.phl.internal (Postfix) with ESMTP id 49B38EC01FB; Sun, 17 May 2026 16:46:11 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Sun, 17 May 2026 16:46:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to; s=fm2; t=1779050771; x= 1779137171; bh=cSXC8xBCRaZmVffmfjiYFfStkz6SoRQPCjE+TTaDpt8=; b=h iBxJG5jS9blWBajVn6CWrxKW1UBzqaYpebryu/0JoLY5d3P1dbm4uBPJ59tUBJtZ 6I/+ITWt8aIFBdXQVlRgXpftmiHx56M3YYMlvohm07tvggTKEBmTx55QIbztCHR3 R71aR9FUkqmN1XrWInko9RLNtc26qZEoZJHyiLExbI5pDEidFqgNqg457nq9ETjK FK1w/zlM+UCyK0A9iG6rL/A7yQAqneDE0/Dt7rpYjMvWmc52O+yEvwqaWIgsFijt v4OEdMule5ME6Y3DKmRV8eUNnAudL/7WZlO1WJxH8dqR6FdXaVz9S0cg0E69lwEd kUKg7k44HhGu5Hc1yScVg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1779050771; x=1779137171; bh=c SXC8xBCRaZmVffmfjiYFfStkz6SoRQPCjE+TTaDpt8=; b=Ci7+R1gyDI9J2uUS7 +CUTTfvKRt9wLZvTmtcbgeYQzSaA7ygUfRa2N64HejcMAgX9cnKZ5O2COjCfUdno u+2cwY6Pt7QYVuUWAkBiybRk0dRfcCVcBShgxiqiIas7l55gqizFWM2WMGOIcmhU Tn7T/ARZ6ufmlGTDehJQpNKCYw4DtrWA/FfKPqpDhIvDK3B6YnkVecN8fT4Qt4wI RZhBsCFlEpQg0XtSZfwXPooEAV+FgQv3n89P9+dJy3B5Rnc+ChJlZHdKOlkBKWtq u1J+y5aV5hgrnXe+XPvq37eRM71XTbpmmTExra2+IIHJegXdsmqbih+czDYKpq+G fqxvQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgddufeeileejucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpeffhffvvefukfggtggugfgjsehtkeertd dttdejnecuhfhrohhmpeetlhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvges khhurhhilhgvmhhurdguvgeqnecuggftrfgrthhtvghrnhepieehheekkeelgeeuieefvd ffgedtudegffehheeffedtudfhtdekfeelleekffejnecuffhomhgrihhnpegvnhhtvghr phhrihhsvggusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpegrlhhvhhgvrhhrvgeskhhurhhilhgvmhhurdguvgdpnhgspghrtghp thhtohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepsggrjhhirdhpghguvg hvsehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslhhi shhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 17 May 2026 16:46:10 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1779050768; bh=Ejb53dIVKw0+v8QaiXnL8eoEf8IbQd0kvLxNFZIXEPQ=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=GLVMqJXk1FwnhaE5V2h8UaqenMpzslRJPldu+SU/D0YVYV9nbskJ68oS+vJIGIXdD 9MZI38l7XjzZx/H0kUNuyRN1V5Jz/+kwtFQh0bvcpEvCJ0I4ZykDSP/1wLeb1p5fRG wqAxB57zIRO3LnZcePc8+/4h8xSQkhL0pRGoNEBd7+tB3jvM+wFhDFxeeHCYmnokug /kkNZdAe1Iv8G2vPxek8LjEtxSc7rT4f6ls3LEVqe5l7r5qQgazlWCrbLe5YYkuPeb JpgoQx+DCnjCCshnj8YScppIx/ve7LNURiNNsuurjRlJ2OkIyRk0CAP+ell4jKIV5D mWE3grQnZI7Cg== Received: by ida.kurilemu.internal (Postfix, from userid 1000) id CC87DB05EEA; Sun, 17 May 2026 22:46:08 +0200 (CEST) Date: Sun, 17 May 2026 22:46:08 +0200 From: Alvaro Herrera To: Baji Shaik Cc: pgsql-hackers@lists.postgresql.org Subject: Re: [PATCH] Fix REPACK decoding worker not cleaned up on FATAL exit Message-ID: 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 On 2026-May-12, Baji Shaik wrote: > Root cause: > > pg_terminate_backend() causes ereport(FATAL) via ProcDiePending. > FATAL exits bypass PG_FINALLY blocks, so stop_repack_decoding_worker() > is never called. The decoding worker is left running. > > Fix: > > Register an on_proc_exit callback when the decoding worker starts. I think a better fix for this is to use PG_ENSURE_ERROR_CLEANUP(). That way we avoid leaving callbacks in place, which would not be great if the same backend does a lot of REPACKs: after a dozen or so, it dies with FATAL: out of before_shmem_exit slots -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "La rebeldía es la virtud original del hombre" (Arthur Schopenhauer)