fix: set report.excludeNetwork=true before getReport() to avoid blocking PTR lookups#6404
Conversation
|
@jdz321 is attempting to deploy a commit to the rollup-js Team on Vercel. A member of the Team first needs to authorize it. |
lukastaegert
left a comment
There was a problem hiding this comment.
I was not aware, nice improvement!
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Here's a fun one, let me share how we stumbled into this bug. While building a project with Vite 8 + vite-plugin-pwa, the Vite build itself completed quickly, but the PWA build step took an extra ~30 seconds to finish. After investigation, the root cause turned out to be a The reason this only appears with Vite 8 is subtle: Vite 7 and earlier use rollup as the build engine, so |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6404 +/- ##
=======================================
Coverage 98.78% 98.78%
=======================================
Files 274 274
Lines 10785 10789 +4
Branches 2882 2882
=======================================
+ Hits 10654 10658 +4
Misses 89 89
Partials 42 42 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Head branch was pushed to by a user without write access
|
the test now skips on Windows since |
|
This PR has been released as part of [email protected]. You can test it via |
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Description
native.jscallsreport.getReport()during module initialization to detect the platform (isMingw32/isMusl).report.getReport()enumerates all libuv TCP handles and performs a reverse DNS (PTR) lookup on each one. When active TCP sockets are present and the remote IP's PTR query returnsSERVFAIL, the call blocks until DNS times out.This affects projects where a plugin calls
fetch()during a build, leaving a keep-alive socket in undici's pool, and a later plugin import triggersnative.jsto load.Fix: set
report.excludeNetwork = truebefore callingreport.getReport()and restore the previous value afterwards. For the WindowsspawnSyncpath,excludeNetworkis set inside the child script.Ref: nodejs/node#55576
Ref: nodejs/node#55602