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 1qxE9o-00Gvqk-8W for pgsql-hackers@arkaria.postgresql.org; Sun, 29 Oct 2023 22:21:20 +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 1qxE9m-009c5v-5r for pgsql-hackers@arkaria.postgresql.org; Sun, 29 Oct 2023 22:21: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.94.2) (envelope-from ) id 1qxE9l-009c5m-SZ for pgsql-hackers@lists.postgresql.org; Sun, 29 Oct 2023 22:21:17 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qxE9j-003iwT-5g for pgsql-hackers@postgresql.org; Sun, 29 Oct 2023 22:21:17 +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 39TML6Hd2268826; Sun, 29 Oct 2023 18:21:06 -0400 From: Tom Lane To: Alexander Korotkov cc: Mikhail Gribkov , Michael Paquier , Robert Haas , Daniel Gustafsson , Andres Freund , Greg Nancarrow , Ivan Panchenko , Teodor Sigaev , Ibrar Ahmed , vignesh C , Pavel Stehule , PostgreSQL Hackers , Amit Kapila , Masahiko Sawada Subject: Re: On login trigger: take three In-reply-to: References: <2133270.1698592561@sss.pgh.pa.us> Comments: In-reply-to Alexander Korotkov message dated "Mon, 30 Oct 2023 01:09:56 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2268824.1698618066.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Sun, 29 Oct 2023 18:21:06 -0400 Message-ID: <2268825.1698618066@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alexander Korotkov writes: > On Sun, Oct 29, 2023 at 6:16 PM Tom Lane wrote: >> It looks to me that what happened here is that the backend completed the >> authentication handshake, and then the login trigger caused a FATAL exit, >> and after than the connected psql session tried to send "SELECT 1" on >> an already-closed pipe. That failed, causing IPC::Run to panic. Looking closer, what must have happened is that the psql session ended before IPC::Run could jam 'SELECT 1' into its stdin. I wonder if this could be stabilized by doing 'psql -c "SELECT 1"' and not having to write anything to the child process stdin? But I'm not sure this test case is valuable enough to put a great deal of work into. >> mamba is a fairly slow machine and doubtless has timing a bit different >> from what this test was created on. But I doubt there is any way to make >> this behavior perfectly stable across a range of machines, so I recommend >> just removing the test case involving a fatal exit. > Makes sense. Are you good with the attached patch? OK by me, though I note you misspelled "mallory" in the comment. regards, tom lane