Windows abrupt shutdown & Coverage - #335
Conversation
detail::timer's consumers construct it only from an execution context and set expiry separately, so the time-point, duration, and executor convenience constructors had no callers. The move operations only exist so a disengaged std::optional<timer> can be moved; io_object already implements the transfer, so defaulting them replaces the out-of-line definitions.
make_win_timers has always returned the thread-based timers; the NtAssociateWaitCompletionPacket path was compiled but unreachable behind #if 0. The reason it lost — one-shot packets force a full re-association on every scheduler wakeup — now lives at the selection site.
Both engines latched a setup error for a bad trust anchor but silently dropped an entity certificate or private key that failed to parse or decrypt, deferring the misconfiguration to an opaque handshake failure on the peer. Latch the same flag on those paths: the OpenSSL engine refuses the handshake through check_context(), wolfSSL refuses directly from init. Cover the credential-parsing paths from both sides: a full engine handshake from DER-converted fixtures, plus setup refusal for a garbage DER certificate and for a key whose oversize callback password is truncated to OpenSSL's buffer.
…tdown The shutdown drain waited for the run-loop work counter to reach zero, but that counter includes work-guard credits — and a coroutine frame abandoned with a parked operation at teardown (the documented shutdown contract) holds its run_async guard forever, so the destructor spun on a credit that could never be returned. The drain's actual precondition is narrower: no packet referencing overlapped-op memory may remain in flight to the completion port when the services free that memory. Count exactly that — a packet is owed after on_pending's publish (the kernel's completion will dispatch) or a successful stored-result post, and consumed at the single dispatch point per operation — and let shutdown reap until this count is zero. The run-loop counter keeps its original meaning untouched, and guards, posted handlers, and queued continuations are simply outside the drain's concern.
Completions can reach the port or the deferred queue without a matching work credit — posted directly against the handle, or left behind once their credit was consumed. Destroy them after the counted drain so service teardown does not free state they still reference.
Most local-stream socket and acceptor tests were gated behind BOOST_COROSIO_POSIX from before connect_pair and AF_UNIX support existed on Windows. Ungate everything that needs only the public API, keeping the raw-fd backlog test POSIX-only, and add tests for wait(error) cancellation, in-flight read cancellation through cancel() and stop tokens, zero-length transfers, socket options, and acceptor waits. The acceptor wait(write) test skips io_uring, whose poll never reports a listener writable. Also add direct unit tests for intrusive_list and intrusive_queue, option get/set round-trips with closed-object throws for the TCP and local acceptors, a delay test that re-issues waits so timer impls are drawn back out of the thread-local cache slot and the service free list, and coverage for both the WSA and Win32 forms of the IOCP error-code mapping.
Run the parked-accept and parked-read teardown tests for both local stream and TCP sockets on Windows, where they previously never ran. Destroying the context with operations still parked abandons their coroutine frames by design; these pin the IOCP shutdown drain to that contract.
Both were gated with the raw-socket includes even though only the backlog test touches raw sockets — and its calls are identical in Winsock apart from the handle type and closesocket. The no-listen accept gains the watchdog canceller used by its local-stream sibling, since a platform may park the accept instead of failing it.
local_endpoint is a value type, so constructing, classifying, and formatting an abstract address needs no kernel support; only binding one is Linux-specific. Ungate those checks, and verify on Windows that binding an abstract endpoint is refused with operation_not_supported rather than binding something else.
|
An automated preview of the documentation is available at https://335.corosio.prtest3.cppalliance.org/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-08-11 19:03:24 UTC |
|
GCOVR code coverage report https://335.corosio.prtest3.cppalliance.org/gcovr/index.html Build time: 2026-08-11 19:18:16 UTC |
The interleaved deadlines were all a few milliseconds out and the test asserted the middle three were canceled before any fired — a wall-clock race that fails under heavy slowdown (observed under valgrind, where all five expired first). Park the cancel targets hours out so no slowdown can expire them; only the two short delays ever fire, and removing the middle hour entry still exercises heap interior removal.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #335 +/- ##
========================================
Coverage 79.81% 79.82%
========================================
Files 96 96
Lines 5946 5937 -9
Branches 1213 1209 -4
========================================
- Hits 4746 4739 -7
+ Misses 852 851 -1
+ Partials 348 347 -1
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
No description provided.