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.94.2) (envelope-from ) id 1rpYIE-007JEu-D7 for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Mar 2024 18:46:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rpYID-001DVw-Hw for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Mar 2024 18:46:33 +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.94.2) (envelope-from ) id 1rpYID-001DTe-6y for pgsql-hackers@lists.postgresql.org; Wed, 27 Mar 2024 18:46:33 +0000 Received: from wfhigh4-smtp.messagingengine.com ([64.147.123.155]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rpYI6-006prW-0Q for pgsql-hackers@lists.postgresql.org; Wed, 27 Mar 2024 18:46:32 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.west.internal (Postfix) with ESMTP id C5BE018000AC; Wed, 27 Mar 2024 14:46:22 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 27 Mar 2024 14:46:24 -0400 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-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1711565182; x= 1711651582; bh=VqS+sfp9HQxb/otBJLYbcJGrJJQGi8XeV40BEfY4mwY=; b=d oOlVeQbQcvhjoV5bjYnDXSehYUR7xdtBTa4Vc1RfVpiJNZVq+noZf5WcRgu/Np8W tJvrW8kczn7GQycEEa8YbnxxQgVi7Vcnq6NR5r51KMoX4VwxzjiA7fbFcvbe0SRq 5ZkKBcNBkMo1MbR5GyYTYu0ew0rtPTEU7FKmz/GVdJpDf0pqbvwhX62zP//YU47W k8O5FthtOZ9W2Jf9ZPJ5ZlwvVt8yAj96Nzuly2nI9TPnTabcA+mtimQZIqbVsOGg r2XltV4ggdsePiXFxPSTIlst23b7e8ZnxJYSlqx0V/aETiEdaDnVqSuscaNsfJ77 FodK+mXpOqwsSnHXfd4Fg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudduiedgledvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepvdektdffudfftdffffehfffhjeejhffgieeuueekjeek fffgudffhfduffffueevnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhv hhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 27 Mar 2024 14:46:21 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1711565179; bh=GhC1dg3wGHNg19URpAasOYbZQ8us1QNZXkAywlKYbcs=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=P1Kz9iUTpcbhwLgaboJGp25EFbHh4amiUCYlfbHvtPMe+/r1WYKZjuDWyGBkQac8S wkdSRxprlONIUTQ3RwzQ7XXcxnJfFSwEQIU4ZBxMuQTYqBu/50erBrxz10yTNi4Rm4 cw7BFMckwCAngsbo3dm/o1foQwnDzf3Byq8C6dLgFgpjrGbCRKbGnT6RfwprEx3M43 1j99dxbCBawgoyf/HTMS/Wg8RWl8c/fJODBPTmoNDyMbJgNS8JoNOyby9jJyK5uwDf rII+8H7it45kJrMIALns8fcbijfmEbFq5E4C11x0lSjT85uIh4zxPQLAzsFyzgSSTQ Our+tx7M1Rdgw== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id D8569385; Wed, 27 Mar 2024 19:46:19 +0100 (CET) Date: Wed, 27 Mar 2024 19:46:19 +0100 From: Alvaro Herrera To: Jelte Fennema-Nio Cc: Noah Misch , Jacob Champion , Tom Lane , Denis Laxalde , vignesh C , Thomas Munro , Greg Stark , "Gregory Stark (as CFM)" , Jelte Fennema , Daniel Gustafsson , Peter Eisentraut , Andres Freund , Justin Pryzby , Robert Haas , pgsql-hackers@lists.postgresql.org, Etsuro Fujita Subject: Re: [EXTERNAL] Re: Add non-blocking version of PQcancel Message-ID: <202403271846.yfbljes2v3zq@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202403271534.4eq4o2ofrxsx@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2024-Mar-27, Alvaro Herrera wrote: > I changed it so that the error messages are returned as translated > phrases, and was bothered by the fact that if errors happen repeatedly, > the memory for them might be leaked. Maybe this is fine depending on > the caller's memory context, but since it's only at most one string each > time, it's quite easy to just keep track of it so that we can release it > on the next. (Actually this sounds clever but fails pretty obviously if the caller does free the string, such as in a memory context reset. So I guess we have to just accept the potential leakage.) -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "La conclusión que podemos sacar de esos estudios es que no podemos sacar ninguna conclusión de ellos" (Tanenbaum)