Repository navigation
Close half-open companion connections on shutdown - #158
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
CompanionServer.close() destroyed only the sockets Node's closeAllConnections() knows about, which are the ones that finished the TLS handshake. A phone that opened a TCP connection but never sent its ClientHello kept close() waiting for Node's 120 s handshake timeout. The paused-Mac step of the iPhone CI flow answers /resume only after dispose() returns, so on a slow simulator the UI test's 10 s wait expired first (run 37983100896, main at #154). The runner's Session log showed its wait ending on schedule, which placed the stall in the fixture. Track every accepted socket per server and destroy them all in close(). A unit test holds a half-open connection and requires dispose() to return promptly; it timed out at 5 s before the fix. Reproduced against the real fixture with one half-open connection: no reply in 15 s before, 204 in 6 ms after. Co-Authored-By: Claude Fable 5.1 <[email protected]>
BunsDev
force-pushed
the
companion-close-handshake
branch
from
October 10, 2026 01:16
efe3516 to
3d86680
Compare
The commit's pull_request run passed the whole paired iPhone flow while its push run (38012518622) failed at the first follow-up, before the pause-and-resume step this change affects. The phone's log shows one request hitting its 8 s timeout ten seconds before the send tap and no later request failing. The fixture writes no log, so the status page now says what is known and what to add first if it recurs. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This was referenced Oct 11, 2026
This branch was successfully deployed
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.
Why
iPhone companionfailed onmainat #154 (run 37983100896) after the readiness fixes in #153 had landed. The paired flow's/resumecall to the Mac fixture timed out:/resumeonly afterCompanionServer.dispose()returns, andhttps.Server.close()was waiting on a socket the phone had opened but never carried through the TLS handshake.closeAllConnections()only knows sockets that completed TLS, so Node held the server open until its 120 s handshake timeout.What
CompanionServertracks every accepted socket per server and destroys them all inclose(). Turning the companion off, quitting the Mac app, or rebinding after a network change no longer waits on a half-open connection.dispose(). It timed out at 5 s before the fix.docs/status.md: unreleased entry and cause (4) in the iPhone CI rough edge.Verification
8935eafreconciles Stabilize macOS layout and Knowledge E2E readiness #167 without changing the reviewed fix's tree.npm run build && npm testpassed: 469 passed, 1 skipped. The half-open connection regression passed in 142 ms; independent integration review confirmed the original source/test and retained status entries.app.close()inrelease.spec.ts, before the CLI-stop fixture started. Its cause remains unresolved. Twelve immediate-close probes, four native-quit controls, and three runs of the exact original test passed locally. The single diagnostic hosted rerun with debug logging passed. All four current-head checks are green; the original timeout remains unreproduced and its cause unresolved.fixture.mjsregression with a half-open connection changed/resumefrom no reply within 15 s before the fix to HTTP 204 in 6 ms afterward.