Skip to content

node:worker_threads: implement postMessageToThread [1bx5ty] - #29828

Closed
robobun wants to merge 51 commits into
mainfrom
farm/6140e626/worker-postMessageToThread
Closed

node:worker_threads: implement postMessageToThread [1bx5ty]#29828
robobun wants to merge 51 commits into
mainfrom
farm/6140e626/worker-postMessageToThread

test: bump timeouts on execArgv/environmentData subprocess tests

d284e83
Select commit
Loading
Failed to load commit list.
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

See this annotation in the file changed.

@claude 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`