Repository navigation
Conversation
Root cause of the intermittent HttpServerStop/floor-Node flake: macOS SO_REUSEADDR lets foreign local listeners inside the ephemeral range (e.g. Spotify wildcard IPv4 :57621, Chrome-specific 127.0.0.1:54677) silently overlap our listener bind. Node's default listen uses the dual-stack IPv6 wildcard, and 127.0.0.1 traffic then gets delivered to the foreign process (measured: status 200 with foreign body), making 127.0.0.1-based test reads fail. Deno rejects the overlap with EADDRINUSE and binds the IPv4 wildcard, so 127.0.0.1 stays correct. Fix is test-only: clients read from the loopback family matching the bound listener ([::1] for Node, 127.0.0.1 for Deno). No server or public API change; wildcard bind behavior is unchanged. Evidence: 2000-cycle stress reproduces an empty-body 200 on 127.0.0.1 (cycle 1169, foreign port 54677) while [::1] completes 2000/2000.
Use one shared public-address helper for both HTTP suites. Capture origins before stop clears the listener, and resolve fresh origins after restart. IPv4-only Node listeners no longer receive IPv6 requests; dual-stack listeners still avoid foreign IPv4 SO_REUSEADDR overlap on macOS. Verified real IPv4/IPv6 Node sockets and deterministic controlled overlap; previous IPv6-only helper fails ECONNREFUSED on IPv4. Preserve HTTP35/71 assertions and NodeHTTP6/10 assertions. Full Deno/Node/browser suites pass on Deno 2.9.1 and actual floor 2.3.3 (740/740, 740/740, 435/435 each); repeated HTTP suites, checks and asset builds pass on both.
ofriw
marked this pull request as ready for review
October 29, 2026 15:12
This was referenced Oct 29, 2026
Closed
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.
Scope and dependency
Layer 10/11 of the verified replacement for #66 / stack #80. Base: #89. Review and integrate bottom-up; each complete PR tip passes all runtimes without a later unpublished fix.
Contract and migration
Breaking: await HttpServerInstance.stop() and Server.stop() (Promise). New requests during drain receive 503/connection: close. Default timeout is 10s; timeoutMs must be an integer 0..2147483647. Force/timeout do not cancel application handlers. ALB health checks accept http/https/any port/query but require exactly lowercase /healthy; use lowercase probe paths.
Verification —
3315ed8baf7a852245c450cf7dcec27292bf71c4Verified locally on this exact tip with current Deno 2.9.1 and the actual floor 2.3.3 executable, Node 24.14.1, and Playwright 1.64.1/Chromium. The full Deno, Node and browser suites ran separately for each Deno version. Public+worker checks and repeated generated-asset builds passed on both versions. These are measured local gates, not a claim that remote Actions have completed.
All reported cases passed. Before #91 the inherited runner counts some runtime-gated early returns as passes; these totals do not claim explicit skip accounting. Summaries and nonzero counts were checked, not exit status alone.
Additional gates on both versions: three targeted Node HTTP35/35 and NodeHTTP6/6 repetitions, plus Deno HTTP35/35. Real IPv4, IPv6 and controlled macOS overlapping-listener probes passed. No production bind API was added.
Review boundary
All 49 source commits in
2be88b35..23d6c6d0were independently audited across this replacement; the final combined tree also passed review. Intentional departures are co-located: real verification prerequisites, browser path coverage, restored registry guard, portable HTTP tests, and truthful skip display. No binary codec or protected AGENTS/CLAUDE/README changes.Changed-code checks passed without new diagnostics or suppressions. Inherited broader lint/test-fixture type errors remain; this is not a repository-wide lint/typecheck-clean claim. The final broader changed-file lint has 23 inherited diagnostics. No remote merge or issue edit is part of this replacement.
Stack: https://github.com/goatplatform/goatdb/stack/92