pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alexander Korotkov <aekorotkov@gmail.com>
Cc: Mikhail Gribkov <youzhick@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Daniel Gustafsson <daniel@yesql.se>
Cc: Andres Freund <andres@anarazel.de>
Cc: Greg Nancarrow <gregn4422@gmail.com>
Cc: Ivan Panchenko <wao@mail.ru>
Cc: Teodor Sigaev <teodor@sigaev.ru>
Cc: Ibrar Ahmed <ibrar.ahmad@gmail.com>
Cc: vignesh C <vignesh21@gmail.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>
Subject: Re: On login trigger: take three
Date: Sun, 29 Oct 2023 18:21:06 -0400
Message-ID: <2268825.1698618066@sss.pgh.pa.us> (raw)
In-Reply-To: <CAPpHfds1WuQOiqafsFjH8o_D1jVKjgH2im+VJb-NXtARvxUBqw@mail.gmail.com>
References: <CAPpHfduF9LHW5PK4si=gpRUnWrwi0J_aNC6rh4BkSgqkz5MYZA@mail.gmail.com>
	<CAPpHfdsVgL6cb4a60oXH5aydXMVF5Z2sgBc1_MsobVibREJYAA@mail.gmail.com>
	<CA+TgmobhCCdoz2ycDOY6D_Kh8aR3CHE2XacyY=FXgej00OoVyA@mail.gmail.com>
	<CAPpHfdv8CfmoQxnrt34VWBdQWgkFU1E80xk-SOvSxtpmvfnoYQ@mail.gmail.com>
	<CA+TgmoY4CsW06e+3_zCO1FgkZntijscQb34KTokMJixdAdjWXg@mail.gmail.com>
	<CAPpHfduP=Tw7PQsoxs3nrvfVmB8JCXfU7ZCR82yJc3Y5FPXkKQ@mail.gmail.com>
	<CA+TgmoZWtP2Pr8PurLV2zH+a_WM6cUcXAwBcWpS9Vw5QUfbnPQ@mail.gmail.com>
	<CAPpHfdtOd2eiyE_wN2rfWconeH0BR3gk2n_uQWf6RQvBDvpPBg@mail.gmail.com>
	<CAPpHfdudXAO7QMFcgHJ_wjUt_NqkpOGC+_OhdUJnBfWf+7w_Bg@mail.gmail.com>
	<CAPpHfdvrOcmCXCYtpDG36=idH8RdhUWukXbvt_4DOTMessJQeQ@mail.gmail.com>
	<ZSyLN2HTz_iLSKkH@paquier.xyz>
	<CAPpHfdsbD9sxJFwhSnbcgvii0=gT+7j3XPumNDHZW=mHmVoxOg@mail.gmail.com>
	<CAMEv5_s=s2ZATDf3Zo11naH+25OKuoLyOxtPO+bKPB=qdMd4HQ@mail.gmail.com>
	<CAPpHfdsnBxnh4OWOSe1MyhZN8wZ8Z3CWLPmyc_zg=_MtWmwrFA@mail.gmail.com>
	<CAMEv5_unWRSqnznbRrGaCd00ZYkX9DxYLh1RqX7C1uxumtO! edA@mail.gmail.com>
	<2133270.1698592561@sss.pgh.pa.us>
	<CAPpHfds1WuQOiqafsFjH8o_D1jVKjgH2im+VJb-NXtARvxUBqw@mail.gmail.com>

Alexander Korotkov <aekorotkov@gmail.com> writes:
> On Sun, Oct 29, 2023 at 6:16 PM Tom Lane <tgl@sss.pgh.pa.us> 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





view thread (171+ messages)  latest in thread

Message-ID: <2268825.1698618066@sss.pgh.pa.us>
Permalink:  ../2268825.1698618066@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2268825.1698618066@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, aekorotkov@gmail.com, youzhick@gmail.com, michael@paquier.xyz, robertmhaas@gmail.com, daniel@yesql.se, andres@anarazel.de, gregn4422@gmail.com, wao@mail.ru, teodor@sigaev.ru, ibrar.ahmad@gmail.com, vignesh21@gmail.com, pavel.stehule@gmail.com, amit.kapila16@gmail.com, sawada.mshk@gmail.com
  Subject: Re: On login trigger: take three
  In-Reply-To: <2268825.1698618066@sss.pgh.pa.us>
  References: <CAPpHfduF9LHW5PK4si=gpRUnWrwi0J_aNC6rh4BkSgqkz5MYZA@mail.gmail.com> <CAPpHfdv8CfmoQxnrt34VWBdQWgkFU1E80xk-SOvSxtpmvfnoYQ@mail.gmail.com> <CA+TgmoY4CsW06e+3_zCO1FgkZntijscQb34KTokMJixdAdjWXg@mail.gmail.com> <CAPpHfduP=Tw7PQsoxs3nrvfVmB8JCXfU7ZCR82yJc3Y5FPXkKQ@mail.gmail.com> <CA+TgmoZWtP2Pr8PurLV2zH+a_WM6cUcXAwBcWpS9Vw5QUfbnPQ@mail.gmail.com> <CAPpHfdtOd2eiyE_wN2rfWconeH0BR3gk2n_uQWf6RQvBDvpPBg@mail.gmail.com> <CAPpHfdudXAO7QMFcgHJ_wjUt_NqkpOGC+_OhdUJnBfWf+7w_Bg@mail.gmail.com> <CAPpHfdvrOcmCXCYtpDG36=idH8RdhUWukXbvt_4DOTMessJQeQ@mail.gmail.com> <ZSyLN2HTz_iLSKkH@paquier.xyz> <CAPpHfdsbD9sxJFwhSnbcgvii0=gT+7j3XPumNDHZW=mHmVoxOg@mail.gmail.com> <CAMEv5_s=s2ZATDf3Zo11naH+25OKuoLyOxtPO+bKPB=qdMd4HQ@mail.gmail.com> <CAPpHfdsnBxnh4OWOSe1MyhZN8wZ8Z3CWLPmyc_zg=_MtWmwrFA@mail.gmail.com> <2133270.1698592561@sss.pgh.pa.us> <CAPpHfds1WuQOiqafsFjH8o_D1jVKjgH2im+VJb-NXtARvxUBqw@mail.gmail.com> <2268825.1698618066@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox