I happened to try googling for other similar reports, and I found
a very interesting recent thread here:
https://github.com/nodejs/node/issues/33166
It might not have the same underlying cause, of course, but it sure
sounds familiar. If Node.js are really seeing the same effect,
that would point to an underlying Windows bug rather than anything
Postgres is doing wrong.
It doesn't look like the Node.js crew got any closer to
understanding the issue than we have, unfortunately. They made
their problem mostly go away by reverting a seemingly-unrelated
patch. But I can't help thinking that it's a timing-related bug,
and that patch was just unlucky enough to change the timing of
their tests so that they saw the failure frequently.
regards, tom lane