pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Mikhail Gribkov <youzhick@gmail.com>
Cc: Alexander Korotkov <aekorotkov@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 11:16:01 -0400
Message-ID: <2133270.1698592561@sss.pgh.pa.us> (raw)
In-Reply-To: <CAMEv5_unWRSqnznbRrGaCd00ZYkX9DxYLh1RqX7C1uxumtOedA@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>

Mikhail Gribkov <youzhick@gmail.com> writes:
> Just for a more complete picture of the final state here.
> I have posted the described fix (for avoiding race condition in the tests)
> separately:
> https://commitfest.postgresql.org/45/4616/

It turns out that the TAP test for this feature (006_login_trigger.pl)
also has a race condition:

https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=mamba&dt=2023-10-28%2003%3A33%3A28

The critical bit of the log is

ack Broken pipe: write( 14, 'SELECT 1;' ) at /usr/pkg/lib/perl5/vendor_perl/5.36.0/IPC/Run/IO.pm line 550.

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.

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.

			regards, tom lane





view thread (171+ messages)  latest in thread

Message-ID: <2133270.1698592561@sss.pgh.pa.us>
Permalink:  ../2133270.1698592561@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2133270.1698592561@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, youzhick@gmail.com, aekorotkov@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: <2133270.1698592561@sss.pgh.pa.us>
  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> <2133270.1698592561@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