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 1t968P-007kzY-4i for pgsql-bugs@arkaria.postgresql.org; Thu, 07 Nov 2024 17:17:28 +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 1t968M-00056M-Fk for pgsql-bugs@arkaria.postgresql.org; Thu, 07 Nov 2024 17:17:27 +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 1t968M-00056E-7b for pgsql-bugs@lists.postgresql.org; Thu, 07 Nov 2024 17:17:26 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t968K-000fIz-37 for pgsql-bugs@lists.postgresql.org; Thu, 07 Nov 2024 17:17:25 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 4A7HHL5X3441951; Thu, 7 Nov 2024 12:17:21 -0500 From: Tom Lane To: Noah Misch cc: Francesco Degrassi , pgsql-bugs@lists.postgresql.org Subject: Re: Leader backend hang on IPC/ParallelFinish when LWLock held at parallel query start In-reply-to: <20240918050434.13.nmisch@google.com> References: <20240918030159.2a.nmisch@google.com> <1737570.1726633422@sss.pgh.pa.us> <20240918050434.13.nmisch@google.com> Comments: In-reply-to Noah Misch message dated "Tue, 17 Sep 2024 22:04:34 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3441949.1730999841.1@sss.pgh.pa.us> Date: Thu, 07 Nov 2024 12:17:21 -0500 Message-ID: <3441950.1730999841@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Noah Misch writes: > On Wed, Sep 18, 2024 at 12:23:42AM -0400, Tom Lane wrote: >> I do not have much faith in this patch. It assumes that the >> condition "interrupts can be processed" is the same at plan time and >> execution time. For plans extracted from the plan cache, there seems >> little reason to assume that must be true. The proposed test case >> cannot trigger that (today anyway) because SQL-language functions >> don't deal in cached plans, but I suspect it could be broken with a >> test case using a plpgsql function instead. > Good point. I missed that. While working on the release notes, I noticed that nothing further got done about this concern. What do you think of adding a test somewhere early in executor startup, to the effect of if (!INTERRUPTS_CAN_BE_PROCESSED()) ereport(ERROR, (errmsg("cannot start a query with interrupts disabled"))); It's definitely a band-aid, but it seems better than leaving things at the status quo. regards, tom lane