Repository navigation
Conversation
|
The |
|
Thank you! Will merge it after today's release |
Hi @hyfdev, friendly ping - v1.2.14 is out, could this be merged now? Happy to rebase onto the latest main if needed |
`setup.ts` called `onExit` from `signal-exit` unconditionally on import, so every process importing rolldown got SIGHUP/SIGINT/SIGTERM listeners even though the trace subscriber guard is `null` unless chrome tracing is enabled. `signal-exit` re-raises the signal after its handlers run, and with an inspector attached (`node --inspect`) Node then waits for the debugger to disconnect instead of exiting, leaving orphaned dev servers holding ports. Co-Authored-By: Claude Opus 5.5 <[email protected]>
9ab909b to
35b4739
Compare
✅ Deploy Preview for rolldown-rs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
## [1.2.15] - 2026-10-21 ### 🚀 Features - rolldown_plugin_vite_resolve: add `isBundled` to pick the browser-external stub format (#11260) by @h-a-n-a - dev: mark entry modules in the HMR module graph (#11252) by @h-a-n-a - mark module starts with `// <id>` comments instead of `#region` pairs (#11235) by @IWANABETHATGUY ### 🐛 Bug Fixes - plugin: stop `this.resolve` recursion between plugins with `skipSelf: true` (#11181) by @anzal1 - rolldown_plugin_vite_resolve: handle external `require` for `ssr.target: 'webworker'` (#11205) by @sapphi-red - rolldown_plugin_vite_build_import_analysis: only wrap dynamic imports with static specifiers in __vitePreload (#10879) by @smeng9 - strict-execution-order: wrap eager modules that forward wrapped definers (#11186) by @hyfdev - chunk-import-map: keep common chunk keys unique when enabling inline common chunks (#11230) by @hyfdev - only register signal-exit handler when a trace subscriber is active (#11208) by @DaniilIsupov ### 🧪 Testing - fold hand-unrolled Rust test tables (#11212) by @Brooooooklyn ### ⚙️ Miscellaneous Tasks - deps: upgrade oxc to 0.155.0 (#11228) by @Dunqing - rollup-tests: retriage failed tests (#11251) by @sapphi-red - deps: update rollup submodule for tests to v4.64.12 (#11249) by @rolldown-guard[bot] - deps: update test262 submodule for tests (#11242) by @rolldown-guard[bot] ### ❤️ New Contributors * @anzal1 made their first contribution in [#11181](#11181) * @smeng9 made their first contribution in [#10879](#10879) * @DaniilIsupov made their first contribution in [#11208](#11208) Co-authored-by: shulaoda <[email protected]>
Problem
packages/rolldown/src/setup.tscallsonExitfromsignal-exitunconditionally on import:initTraceSubscriber()returns a guard only when chrome tracing is active (RD_LOG+RD_LOG_OUTPUT=chrome-json, which requires thechrome-tracingfeature of a profile build). In release builds it is alwaysnull, so the handler never does anything. Every process that imports rolldown still gets SIGHUP/SIGINT/SIGTERM listeners.On a signal,
signal-exitremoves its listeners and re-raises the signal withprocess.kill(process.pid, sig). With an inspector session attached (node --inspect+ DevTools), Node goes into its exit path and blocks ininspector::Agent::WaitForDisconnect()instead of exiting. In practice, closing the terminal leaves the dev server orphaned (PPID 1) and still holding its ports, so the next start fails withEADDRINUSE. Vite 8 loads rolldown itself, so this affects any Vite-based dev server run under--inspect.Reported downstream in vikejs/vike#3577 (see also vikejs/vike#3611, where the fix was suggested to live in rolldown).
Fix
Register the
onExithandler only when a trace subscriber guard actually exists. The CLI's ownonExitincli/commands/bundle.tsis left untouched: it only runs in CLI watch mode, where the CLI owns the process.Added
tests/behaviors/no-signal-listeners-on-import.test.ts, which checks that importing rolldown withRD_LOGunset adds no SIGHUP/SIGINT/SIGTERM listeners.Reproduction
app.mjs:run.mjsspawnsnode --inspect=9339 app.mjs, connects an inspector client (/json/list→webSocketDebuggerUrl, sendsRuntime.enable), then sendsSIGHUPto the child.Results (macOS, Node 24.21.0):
[email protected]Waiting for the debugger to disconnect..., process stays alive[email protected]with this change applied todist/index.mjssignal=SIGHUP), inspector gets "target closed"Without an attached debugger the process exits in both cases, so the inspector is required to reproduce this.
Note: I could not build the native binding locally (no Rust toolchain on this machine), so the new test has not been run locally. It relies on CI. The behavior change was verified by applying the same edit to the published dist.
AI disclosure
This PR was prepared with help from Claude Code (investigation, fix, repro, test, and this description). I reviewed the changes and the repro results.
🤖 Generated with Claude Code