node:worker_threads: implement postMessageToThread [1bx5ty] - #29828
Closed
robobun wants to merge 51 commits into
Closed
node:worker_threads: implement postMessageToThread [1bx5ty]#29828robobun wants to merge 51 commits into
robobun wants to merge 51 commits into
Claude / Claude Code Review
completed
Apr 29, 2026 in 45m 31s
Code review found 1 potential issue
Found 2 candidates, confirmed 1. See review comments for details.
Details
| Severity | Count |
|---|---|
| 🔴 Important | 0 |
| 🟡 Nit | 0 |
| 🟣 Pre-existing | 1 |
| Severity | File:Line | Issue |
|---|---|---|
| 🟣 Pre-existing | src/bun.js/bindings/webcore/MessagePort.cpp:384-399 |
MessagePort::close() does not release the event-loop ref |
Annotations
Check notice on line 399 in src/bun.js/bindings/webcore/MessagePort.cpp
claude / Claude Code Review
MessagePort::close() does not release the event-loop ref
Pre-existing, but since this PR rewrote the ref state machine and added `!m_isDetached` to the `shouldRef` predicate: `MessagePort::close()` sets `m_isDetached = true` but never calls `updateEventLoopRef()`, so a port that acquired an event-loop ref via `onmessage = fn` / `.ref()` leaks it on close — e.g. `const {port1} = new MessageChannel(); port1.onmessage = fn; port1.close();` keeps the process alive. `removeAllEventListeners()` only reaches `updateEventLoopRef()` when `onDidChangeListener`
Loading