Repository navigation
Conversation
Fixes made to the llhttp path did not reach the experimental Milo parser, and CI did not run the tests with Milo enabled: - On socket end, finish() now resumes a parser paused by backpressure, completes a body whose completion was deferred, and parses what is still buffered before signalling EOF, as llhttp does since #5474. Before, a complete response paused by backpressure failed with 'Invalid EOF state'. - A 204/304 with a non-zero Content-Length is delivered without a body and the connection is not reused, as llhttp does since #5864, instead of failing with ResponseContentLengthMismatchError. - Upgrades pass statusText to onRequestUpgrade, and an upgrade handler error now errors the request, as llhttp does since #5761, instead of only destroying the socket and leaving the request without a terminal event. Milo itself rejects Content-Length on 204 responses and Transfer-Encoding on 204/304 responses (RFC 9110 section 8.6, RFC 9112 section 6.1). Skip the tests that expect llhttp's lenient handling when Milo is enabled, using a helper that reads UNDICI_USE_MILO the way the parser does. test/issue-4389.js checked only for 'true' and ran its HTTP/1.0 test with UNDICI_USE_MILO=1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sfj4nEWQ4ovycNDjbvXcRs Signed-off-by: Matteo Collina <hello@matteocollina.com>
Add a milo input to the reusable Node.js workflow, passed to every test step as UNDICI_USE_MILO, and a test-with-milo job that runs the suite with Milo on ubuntu-latest for every tested Node.js version, like the WASM SIMD job. Automerge waits for it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sfj4nEWQ4ovycNDjbvXcRs Signed-off-by: Matteo Collina <hello@matteocollina.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## fix/milo-idle-socket-validation #6206 +/- ##
===================================================================
- Coverage 91.76% 91.68% -0.09%
===================================================================
Files 113 113
Lines 44457 44506 +49
===================================================================
+ Hits 40797 40804 +7
- Misses 3660 3702 +42 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sfj4nEWQ4ovycNDjbvXcRs Signed-off-by: Matteo Collina <hello@matteocollina.com>
This branch has not been 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.
Stacked on #6205: this PR targets its branch, so the diff shows only the changes here, and it will move to
mainonce #6205 lands. With Milo,test/interceptors/dns.jsfails onmainbecause of the missing idle socket validation that #6205 adds.CI never ran the test suite with the experimental Milo parser enabled, so fixes made to the llhttp path did not reach Milo, and nothing reported it. I ran every test file of the suites CI runs (434 files) with
UNDICI_USE_MILO=1onmain: 5 files fail, andtest/client.jshangs the run. jest and the cache tests pass. This PR fixes the gaps in undici's Milo integration, skips the cases that Milo rejects by design, and adds a CI job that runs the suite with Milo.Fixes in
lib/dispatcher/parser-h1.jsfinish()now resumes a parser paused by backpressure, completes a body whose completion was deferred, and parses what is still buffered before signalling EOF. Before, a complete Content-Length response paused by backpressure failed withInvalid EOF state(test/client.js), and the failed test left the process running.ResponseContentLengthMismatchError(test/content-length.js).onRequestUpgradereceivesstatusText, so the diagnosticsheadersevent reportsSwitching Protocols. When the upgrade handler throws, the request is now errored, as with llhttp. Before, Milo only destroyed the socket, which the request no longer owned, so the request never received a terminal event (test/node-test/diagnostics-channel/upgrade.js).Skipped with Milo
Milo's parser rejects a 204 with Content-Length, even
Content-Length: 0, and a 204 or 304 with Transfer-Encoding (RFC 9110 §8.6, RFC 9112 §6.1). llhttp accepts these responses and closes the connection when they declare content (#5864, #5941). The 9 tests intest/content-length.jsthat expect this are skipped with Milo until Milo accepts these responses; see ShogunPanda/milo#63.test/issue-4389.jsalready skipped its HTTP/1.0 test for Milo, but only whenUNDICI_USE_MILOwas'true'; the parser also accepts'1'. The newtest/utils/milo.jshelper uses the parser's owngetMiloEnabled().CI
nodejs.ymlgains amiloinput, passed to every test step asUNDICI_USE_MILO, likeno-wasm-simd.ci.ymlgainstest-with-milo, onubuntu-latestfor Node.js 22, 24, 25 and 26, the same matrix as the WASM SIMD job. Automerge waits for it.Testing
UNDICI_USE_MILO=1: all pass. 10 tests are skipped with Milo: the 9 above, plus the HTTP/1.0 test intest/issue-4389.js.🤖 Generated with Claude Code
https://claude.ai/code/session_01Sfj4nEWQ4ovycNDjbvXcRs