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 1rpm6t-008Xhh-Am for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Mar 2024 09:31:47 +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 1rpm6r-00AXW6-Pv for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Mar 2024 09:31:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rpm6r-00AXRQ-Ej for pgsql-hackers@lists.postgresql.org; Thu, 28 Mar 2024 09:31:45 +0000 Received: from mail-yb1-f172.google.com ([209.85.219.172]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rpm6n-006r6p-C1 for pgsql-hackers@lists.postgresql.org; Thu, 28 Mar 2024 09:31:43 +0000 Received: by mail-yb1-f172.google.com with SMTP id 3f1490d57ef6-db3a09e96daso702892276.3 for ; Thu, 28 Mar 2024 02:31:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711618301; x=1712223101; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fNHIozhH4uUsE4bUniCZ/+Bs7s1xkqjc3rz9UIjUSdI=; b=dM1I+cewDOySgd7fsfXFzOtbtqji8uIckEVoDYZ7gPCdfeTaAnWgtLyc8YuO1n48zy mH+JYcU7GX9UGoop1IIF25zxTPoF85FVp1m0WRqu5heEJS2/z4HXngUX1MSAfqRueLc6 /Z3SAhKqfv6cm79iGcgomj6BqVrutEG3nHB+gYP2JDKMe4NS29CVpcDloAWnoNLU4cY8 1Q53IWnerJIQGKkhOR6eVkLFtwY9mykVAyp4Y3U+lY+nCcXzu1VCqwWbTc++D4D6sjLX Kh5wmkLUlEnteQVyUCXUgy5B6ZqFo+yR8hgkcjsz0bp0w8aKQ6VEm+TLnYrBpolIzk5h 7SPA== X-Forwarded-Encrypted: i=1; AJvYcCUKvkSekDO5Vs606hsijOCXsQNZemy4NAOCtiXHkCpFtvP7ceeJZfOlPcCocY+fe3EQzuVs3WA3a1kvXsvKr6LoxMcf3f3P/RcqLKxRCQPz+239 X-Gm-Message-State: AOJu0YyyWgzI95MzwJdOpFgkdAqCTMeQTTqNxEUEv7bmrISZKTllRkez wACpxZFKrQ/Uy2k0k0WP1RNHNg3qkAijAWyK7Os6PsUxfBX2xzGtFAi5hm0PEU9kGI7S55Llu+C viVjT5t50QUucORd+4daN5U4Ab+jnBoaY4pj/bA== X-Google-Smtp-Source: AGHT+IEk88LOtMrjf2hMrAt61EMZI4tRefNbT6saIuu0CBv0xZvZLisK75mAzNgeLkresTUCJkCrRvwt4k09JJL7h0o= X-Received: by 2002:a25:6405:0:b0:dcd:65fa:ea06 with SMTP id y5-20020a256405000000b00dcd65faea06mr2307002ybb.24.1711618301449; Thu, 28 Mar 2024 02:31:41 -0700 (PDT) MIME-Version: 1.0 References: <202403271534.4eq4o2ofrxsx@alvherre.pgsql> <202403271846.yfbljes2v3zq@alvherre.pgsql> In-Reply-To: <202403271846.yfbljes2v3zq@alvherre.pgsql> From: Jelte Fennema-Nio Date: Thu, 28 Mar 2024 10:31:30 +0100 Message-ID: Subject: Re: [EXTERNAL] Re: Add non-blocking version of PQcancel To: Alvaro Herrera 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 Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 27 Mar 2024 at 19:46, Alvaro Herrera wrote: > > 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.) Your changes look good, apart from the prverror stuff indeed. If you remove the prverror stuff again I think this is ready to commit.