T3/disconnect final send#6
Merged
Merged
Conversation
The subject requires poll() before every accept/recv/send. Two best-effort send()s violated this literally: - disconnectClient(): final flush of _out before close() - acceptClient(): 'Server full' rejection at MAX_CLIENTS Both are removed; the kernel now has no send() outside the EPOLLOUT-gated path in handleClientOutput(). Consistent with the errno-after-I/O removal. Accepted regressions (a client disconnected in the same tick its reply was queued gets zero bytes): ERR_PASSWDMISMATCH (464), the 001-005 welcome burst on immediate post-registration QUIT, and the 'Server full' ERROR. Compliant recovery = deferred teardown, tracked as T4. Characterization: WrongPassword/NoPassword now assert recv()==0 (EOF), replacing a tolerant check that guarded nothing. Suite: 139/139.
- CLAUDE.md: fds register EPOLLIN only with on-demand EPOLLOUT (since T1); no disconnect flush (since T3); suite 139/139. - tests/COVERAGE.md: errno-after-I/O row resolved (T2), poll-before-send row resolved (T3, both unpolled sends removed); drop hardcoded line numbers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Removes the last two unpolled send()s in the kernel (disconnectClient flush +
acceptClient "Server full"), satisfying the eliminatory rule "poll before every
accept/recv/send" with zero exceptions. Consistent with the errno-after-I/O
removal (T2). Design tradeoff (losing 464 / welcome-burst / "Server full" on
same-tick disconnects) documented in CLAUDE.md; compliant recovery = deferred
teardown, tracked as T4 (out of scope).
Verification
replacing a tolerant check that guarded nothing
handleClientOutput
Note
CI's audit.sh checks single-poll + fcntl + C++98, but NOT "unpolled send" —
this compliance is verified by review + the new characterization test, not by CI.