Re: BackgroundPsql swallowing errors on windows

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org, Noah Misch <noah(at)leadboat(dot)com>
Subject: Re: BackgroundPsql swallowing errors on windows
Date: 2026-02-17 21:31:02
Message-ID: 1779b4d6-768f-4edb-8cd6-62706d321f32@dunslane.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2026-02-16 Mo 7:17 PM, Andres Freund wrote:
> Hi,
>
> On 2026-02-16 16:38:02 -0500, Andrew Dunstan wrote:
>> Here we are almost exactly a year later. I returned to this work quite
>> recently, and reached a milestone, namely the removal of all calls to
>> BackgroundPsql, with all the TAP tests passing. The XS module still has some
>> problems, and I think I'm inclined not to pursue it, and just rely on the
>> FFI mapping.
>>
>> The current state of this is attached. People who are interested can hit me
>> up for info in Vancouver if not before. I'll work on turning this into a set
>> of commitable patches.
> Nice progress!
>
> I briefly tried this out. The overall resource usage of the test is noticeably
> reduced - and that's on linux with fast fork, so it should be considerably
> better on windows. However, the tests take a lot longer than before, I think
> mostly due to polling for results rather than waiting for them to be ready
> using PQsocketPoll() or such.
>
> E.g. bloom/001_wal takes about 15s on HEAD for me, but 138s with the patch. I
> think that's just due to the various usleep(100_000);
>
>
> FWIW, oauth_validator/001_server fails with the patch at the moment.
>

Try this version. On my machine it's now a few percent faster. I fixed
the polling. I also added pipeline support for large sets of commands,
to minimize roundtrips.

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

Attachment Content-Type Size
Tap-Sessions-v9.patch text/x-patch 206.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2026-02-17 21:35:25 Re: Use standard die() handler for SIGTERM in bgworkers
Previous Message Nathan Bossart 2026-02-17 21:30:57 Re: Use standard die() handler for SIGTERM in bgworkers