Skip to content

bundler: keep BundlerPlugin filter data alive across Worker.terminate() - #36807

Open
robobun wants to merge 10 commits into
mainfrom
farm/1aec9fb8/bundler-plugin-filter-worker-terminate
Open

bundler: keep BundlerPlugin filter data alive across Worker.terminate()#36807
robobun wants to merge 10 commits into
mainfrom
farm/1aec9fb8/bundler-plugin-filter-worker-terminate

review: release ServePlugins' Plugin handle via Plugin::destroy; upda…

4f281e1
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Aug 3, 2026 in 28m 14s

Code review found 1 important issue

Found 1 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 1
🟡 Nit 0
🟣 Pre-existing 0
Severity File:Line Issue
🔴 Important src/runtime/server/server_body.rs:1233-1235 Double Plugin::destroy on cancelled HTML-bundle path after 4f281e1

Annotations

Check failure on line 1235 in src/runtime/server/server_body.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

Double Plugin::destroy on cancelled HTML-bundle path after 4f281e1

Adding `Plugin::destroy` to the `Loaded` arm here double-destroys the plugin on the cancelled HTML-bundle path: `JSBundleCompletionTask::deinit` (js_bundle_completion_task.rs:92-96) already calls `Plugin::destroy` on the same handle, and the `if this.cancelled { return Ok(()); }` at js_bundle_completion_task.rs:547-548 skips the `this.plugins = None` that would prevent it. Trigger: `Bun.serve` with bunfig `[serve.static.plugins]` + HTML route + `server.stop()` mid-bundle → two `JSBundlerPlugin__