Re: [PATCH] pg_stat_activity: make slow/hanging authentication more visible

From: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Robert Haas <robertmhaas(at)gmail(dot)com>, Noah Misch <noah(at)leadboat(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Euler Taveira <euler(dot)taveira(at)enterprisedb(dot)com>, Daniel Gustafsson <daniel(at)yesql(dot)se>
Subject: Re: [PATCH] pg_stat_activity: make slow/hanging authentication more visible
Date: 2025-03-05 00:53:14
Message-ID: CAOYmi+=tkATXFmvvAzwLTwq52YrezFopeoPrkW3pXv6LDFYT6A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Mar 4, 2025 at 4:26 PM Jacob Champion
<jacob(dot)champion(at)enterprisedb(dot)com> wrote:
> But attaching to that injection point succeeded above, for us to have
> gotten to this point... Does that error message indicate that the
> point itself doesn't exist, or that nothing is currently waiting?

Looks like the latter. With the following diff I can reproduce locally:

--- a/src/backend/utils/init/postinit.c
+++ b/src/backend/utils/init/postinit.c
@@ -730,6 +730,7 @@ InitPostgres(const char *in_dbname, Oid dboid,
if (!bootstrap)
{
pgstat_bestart_initial();
+ pg_usleep(1000000);
INJECTION_POINT("init-pre-auth");
}

So I've misunderstood the API. I should have added a background
version of $node->wait_for_event(), or similar.

I'll work on a fix, but it probably won't be fast since I need to
learn more about the injection points architecture. The test may need
to be disabled, or the patch backed out, depending on how painful the
flake is for everybody.

Thanks, and sorry,
--Jacob

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2025-03-05 00:54:20 Re: Parallel heap vacuum
Previous Message Andres Freund 2025-03-05 00:41:38 Re: Flaky 003_start_stop.pl test