You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0232737
Browse filesBrowse the repository at this point in the historyBrowse files
FEATURE-ci-v3-runtime-green: own the listener port on Winsock and bound the truncation fixture past stdio readahead
Two CI blockers at 9c9b47a, both first exposures of lanes repaired in
stage 16:
Windows/mingw64 (acceptance run 46963856090, package run 46963855675):
the installed tls-yes http2 matrix died on the rollback one-shot with
'partial H2 bind was retained' in both linkages. open_listener set
Winsock SO_REUSEADDR, which forcibly binds a port another socket is
actively serving, so the scenario's occupied-port obstacle bind
succeeded and listen() returned ok. Microsoft's socket-security
guidance (bind matrix) requires SO_EXCLUSIVEADDRUSE for servers: the
same-account specific-address second bind fails WSAEADDRINUSE, and a
listening socket carries no TIME_WAIT of its own, so the
restarted-server rebind property POSIX SO_REUSEADDR provided is
preserved. open_listener now sets the platform option (exclusive on
_WIN32, reuseaddr elsewhere); io_poll_sys_listener pins the option and
adds the live-listener bind refusal on every platform, making the
rollback scenarios' precondition a unit contract. The _WIN32 branch is
CI-compiled (no mingw toolchain locally, recorded in the task card).
FreeBSD (acceptance run 46963856090, test-suite.log from the failure
evidence artifact): make check failed 1/235, response_definition
file_send_truncated_mid_send_fails, done==1 with an okay outcome and
end_calls()==1 -- the stage-16 rewrite verification passed, so the
truncation was on disk yet never observed. The reopen_file cursor
reads through std::ifstream whose libc++ basic_filebuf buffers the
FILE* to st_blksize (32 KiB on FreeBSD UFS) and refills 4096/4092
bytes; the two parked 16 KiB chunks drove ~36.8 KiB of fread refills
and staged the remaining 4 KiB of the 40 KiB payload in user space, so
the post-truncate pulls were served from the buffer with no EOF.
Reproduced with a local probe (setvbuf 32 KiB + libc++ refill
schedule + mid-stream truncate: 40960 bytes served, feof==0).
Production pull_file behaved correctly for what it observed on every
platform, so the repair stays in the fixture: the payload grows to
2 MiB (bytes owed after the parked chunk past any plausible
st_blksize) and the bounded wake-and-pull drive to 256 rounds; a
follow-up probe proves the short read now surfaces under 4 KiB-1 MiB
buffers. PORTABILITY.md documents the readahead bound for future
mid-send-mutation tests.
Local gates (macOS arm64 scratch worktree at 9c9b47a + these edits):
response_definition 311/311 x3, response_sources 304/304 x3,
io_poll_sys_listener 46/46 including the new refusal check; cpplint
clean on the changed C++ files; git diff --check clean;
check-skip-rationales clean. The file-size gate's two over-limit files
(connection_engine.cpp, io_poll_backend.cpp) are pre-existing at HEAD
and untouched here.
Copy file name to clipboardExpand all lines: specs/tasks/FEATURE-ci-v3-runtime-green.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -216,3 +216,13 @@ Full local `make check -j1` (TLS=no, g++ 15.2, WSL2): 232/235 pass, 2 platform s
216
216
-[x] Repair: `temp_file::rewrite` now truncates and writes through checked direct syscalls (POSIX `::open(O_WRONLY|O_TRUNC)`/`::write`/`::close`, Windows `_open(_O_WRONLY|_O_TRUNC|_O_BINARY|_O_NOINHERIT)`/`_write`/`_close`, the rig's `rig_write`/`rig_close` shims hoisted above the class) and verifies the visible post-write size via `std::filesystem::file_size`, failing with the sizes in the message. A platform that cannot truncate now fails the suite immediately with evidence instead of corrupting the scenario. The test assertions and the stage-15 drive loop are unchanged.
217
217
-[x] Local gates (macOS arm64 scratch worktree at 0151bdbb + the rig edit): `response_sources` 30/304 green ×3, `response_definition` 32/311 green ×3, `native_http1_parity` green; a guard probe makes the truncating open impossible (chmod 0444) — the new rig throws with the errno evidence (EACCES) while the pre-fix rig silently succeeds, proving both sides of the failure mode; cpplint clean; `git diff --check` clean; the same workflow/platform script-test environmental baseline as stage 15. The Windows `_open` branch was not compiled locally (no mingw toolchain), recorded honestly, CI compiles it.
218
218
-[ ] Full exact-source CI on the working branch (mingw64 tls-yes build past the endpoint link, Windows acceptance, FreeBSD make check past the fixture repair, darwin/macos lanes past the runner-capacity failures).
219
+
220
+
## Stage 17: Winsock exclusive listener ownership and the stdio readahead bound (2026-12-03)
221
+
222
+
-[x] Evidence (run 46963856090 acceptance + run 46963855675 package, both at 9c9b47ae; FreeBSD failure evidence artifact downloaded to `/Volumes/WS_BLACK_SN7100_1TB/tmp-evidence/run-46963856090-freebsd/`): the Windows acceptance job and the mingw64 package job failed identically inside the tls-yes installed matrix — `check-v3-public-http2.py` ONESHOTS `rollback`: `shared.exe <fixtures> managed rollback` died on `partial H2 bind was retained` (both linkages, the first Windows exposure of the installed tls-yes http2 lane past the stage-16 link repairs). The FreeBSD acceptance job failed `gmake check` tls-no 1/235: `response_definition` test 24 `file_send_truncated_mid_send_fails`, checks at lines 858/860 with the stage-16 signature (done==1, outcome not protocol_error, `end_calls()==1`) — the rewrite itself verified (stage-16 rig check green), so the truncation was visible on disk yet never observed by the cursor.
223
+
- [x] Windows root cause: the `rollback` one-shot binds its second listener onto an occupied loopback port and requires the bind to fail (the partial-bind rollback contract). `pollsys::open_listener` set Winsock `SO_REUSEADDR`, which on Windows means "forcibly bind a port another socket is actively serving" — the obstacle bind succeeded, `listen()` returned ok, and the consumer correctly reported the contract violation. On POSIX `SO_REUSEADDR` does not permit an active same-address double bind, so every other platform observed the refusal. Verified against Microsoft's socket-security documentation (bind matrix + "All server applications must set SO_EXCLUSIVEADDRUSE"): same-account specific-address exclusive→exclusive second bind fails `WSAEADDRINUSE`, and a listening socket carries no TIME_WAIT of its own, so the restarted-server rebind property that motivated `SO_REUSEADDR` is preserved (the documented exclusive caveat — a rebinding delay after accepted connections linger — concerns graceful-shutdown residue, not listening sockets).
224
+
-[x] Windows repair: `open_listener` sets `SO_EXCLUSIVEADDRUSE` on `_WIN32` and `SO_REUSEADDR` elsewhere; `io_poll_sys_listener` pins the platform option AND adds the live-listener bind refusal (a second `open_listener` on the bound port must return `k_invalid_socket`) on every platform — the rollback scenarios' precondition is now a pinned unit contract, not just an installed-consumer outcome. The hpp contract comment and the Makefile.am suite description updated. The `_WIN32` branch was not compiled locally (no mingw toolchain), recorded honestly; the Windows/mingw64 CI lanes compile and run it.
225
+
-[x] FreeBSD root cause: the reopen_file cursor reads through `std::ifstream`, whose libc++ `basic_filebuf` wraps a `FILE*` buffered to the filesystem's `st_blksize` (macOS/Linux 4 KiB; FreeBSD UFS 32 KiB; ZFS up to 128 KiB), refilling 4096 then 4092 bytes per underflow. The two parked 16 KiB chunks drive ~36.8 KiB of `fread` refills, staging the remaining 4 KiB of the 40 KiB payload in user space; after the (verified) truncate to 100 bytes the final pulls are served entirely from the buffer — no error, no EOF, `feof()==0` — and the send legally completes. Reproduced exactly with a local probe (macOS clang++, `setvbuf` 32 KiB, libc++ refill schedule, truncate mid-stream: total served 40960, feof 0). Production `pull_file` behaved correctly for what it observed on every platform — same standard as stage 16; the repair belongs in the fixture.
226
+
-[x] FreeBSD repair: the test payload grows to 2 MiB (bytes owed after the parked chunk ≈ 2 MiB, past any plausible `st_blksize`) and the bounded wake-and-pull drive grows to 256 rounds so buffered pulls drain before the shrink must surface; the test comment and PORTABILITY.md document the readahead bound for future mid-send-mutation tests. A permanent stall still fails the same assertions with the same evidence.
227
+
-[x] Local gates (macOS arm64 scratch worktree at 9c9b47ae + these edits): `response_definition` 32/311 checks green ×3 (the enlarged fixture included), `response_sources` 30/304 green ×3, `io_poll_sys_listener` green including the new live-listener refusal; cpplint clean on the changed C++ files; `git diff --check` clean; the same workflow/platform script-test environmental baseline as stages 15/16.
228
+
-[ ] Full exact-source CI on the working branch (mingw64 and Windows acceptance past the installed http2 rollback, FreeBSD make check past the readahead bound, darwin/macos lanes green).
0 commit comments