On 16/10/2026 21:28, Harrison Booth wrote:
I agree here. v2 (attached) passes a separate exception set through
select_loop() and checks it on all platforms. The existing EINTR loop
is unchanged.
All seven Windows assertions pass on native x64 and ARM64. Linux
passes eight existing upgrade scripts plus EINTR,
exceptional-readiness & refused-connect controls.
I also tested it alongside the --initdb v8 proposal on 89e06d while
retaining the test registrations. It applies to 1d45c5d.
@@ -396,13 +400,16 @@ wait_on_slots(UpgradeTaskSlot *slots, int numslots)
if (slots[i].sock < 0)
pg_fatal("invalid socket");
FD_SET(slots[i].sock, slots[i].select_mode ? &input : &output);
+ /* Failed nonblocking connects are exceptional on Windows. */
+ if (!slots[i].select_mode)
+ FD_SET(slots[i].sock, &exceptions);
maxFd = Max(maxFd, slots[i].sock);
}
Any reason to not set the exception set when select_mode == true ?
/*
* If we found socket(s) to wait on, wait.
*/
- if (select_loop(maxFd, &input, &output) == -1)
+ if (select_loop(maxFd, &input, &output, &exceptions) == -1)
pg_fatal("%s() failed: %m", "select");
/*
- Heikki