From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Drouvot, Bertrand <bertranddrouvot.pg@gmail.com>
Cc: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Add a new BGWORKER_BYPASS_ROLELOGINCHECK flag
Date: Sun, 15 Oct 2023 22:47:22 -0400
Message-ID: <2186072.1697424442@sss.pgh.pa.us> (raw)
In-Reply-To: <ZSyebsiub88pyJJO@paquier.xyz>
References: <CALj2ACWdR1S6goq2WACeao+jERRNs7ntTBxZY+Rde+E6w=BQ-Q@mail.gmail.com>
<06124373-5fdd-4925-9424-9d036d481f3b@gmail.com>
<590ec36a-13cb-4253-934b-b6a220d1026e@gmail.com>
<ZSTn66_BXRZCeaqS@paquier.xyz>
<2b530754-56c0-4272-a326-11d30a0bca55@gmail.com>
<ZSXdsqU0QlhYrw-r@paquier.xyz>
<ZSYZLPpOubzCh_7o@paquier.xyz>
<d75f9c57-3939-4044-ab87-d0b64074c3e1@gmail.com>
<ZSc9TENI9nYIvh3D@paquier.xyz>
<43fe63f9-a324-4a78-97f8-ebe10e73e61e@gmail.com>
<ZSyebsiub88pyJJO@paquier.xyz>
Michael Paquier <michael@paquier.xyz> writes:
> The buildfarm has provided some feedback, and the new tests have been
> unstable on mamba:
> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=mamba&dt=2023-10-15%2005%3A04%3A21
Yeah. FWIW, I tried to reproduce this on mamba's host, but did not
see it again in 100 or so tries.
> In more details:
> # poll_query_until timed out executing this query:
> # SELECT datname, usename, wait_event FROM pg_stat_activity
> # WHERE backend_type = 'worker_spi dynamic' AND
> # pid = ;
> # with stderr:
> # ERROR: syntax error at or near ";"
> # LINE 3: pid = ;
> So this looks like a hard failure in starting the worker that should
> bypass the role login check. The logs don't offer much information,
> but I think I know what's going on here: at this stage of the tests,
> the number of workers created is 7, very close to the limit of
> max_worker_processes, at 8 by default. So one parallel worker spawned
> by any of the other bgworkers would be enough to prevent the last one
> to start, and mamba has been slow enough in the startup of the static
> workers to show that this could be possible.
I agree that that probably is the root cause, and we should fix it
by bumping up max_worker_processes in this test.
But this failure is annoying in another way. Evidently,
worker_spi_launch returned NULL, which must have been from here:
if (!RegisterDynamicBackgroundWorker(&worker, &handle))
PG_RETURN_NULL();
Why in the world is that "return NULL", and not "ereport(ERROR)"
like all the other failure conditions in that function?
If there's actually a defensible reason for the C code to act
like that, then all the call sites need to have checks for
a null result.
(cc'ing Robert, as this coding originated at 090d0f205.)
regards, tom lane
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, michael@paquier.xyz, robertmhaas@gmail.com, bertranddrouvot.pg@gmail.com, bharath.rupireddyforpostgres@gmail.com
Subject: Re: Add a new BGWORKER_BYPASS_ROLELOGINCHECK flag
In-Reply-To: <2186072.1697424442@sss.pgh.pa.us>
References: <CALj2ACWdR1S6goq2WACeao+jERRNs7ntTBxZY+Rde+E6w=BQ-Q@mail.gmail.com> <06124373-5fdd-4925-9424-9d036d481f3b@gmail.com> <590ec36a-13cb-4253-934b-b6a220d1026e@gmail.com> <ZSTn66_BXRZCeaqS@paquier.xyz> <2b530754-56c0-4272-a326-11d30a0bca55@gmail.com> <ZSXdsqU0QlhYrw-r@paquier.xyz> <ZSYZLPpOubzCh_7o@paquier.xyz> <d75f9c57-3939-4044-ab87-d0b64074c3e1@gmail.com> <ZSc9TENI9nYIvh3D@paquier.xyz> <43fe63f9-a324-4a78-97f8-ebe10e73e61e@gmail.com> <ZSyebsiub88pyJJO@paquier.xyz> <2186072.1697424442@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