Skip to content

worker: fix messageerror listener cleanup - #65783

Open
kiliczsh wants to merge 1 commit into
nodejs:mainfrom
kiliczsh:fix-worker-messageerror-listener-cleanup
Open

worker: fix messageerror listener cleanup#65783
kiliczsh wants to merge 1 commit into
nodejs:mainfrom
kiliczsh:fix-worker-messageerror-listener-cleanup

Conversation

@kiliczsh

@kiliczsh kiliczsh commented Sep 4, 2026

Copy link
Copy Markdown

Worker exit cleanup attempts to remove messageerror listeners before
emitting the exit event, but uses the non-existent messageerrors event
name. As a result, messageerror listeners are still present while exit
listeners run, unlike message listeners.

Use the correct event name during cleanup. Add a regression test covering
both normal worker exit and termination with worker.terminate().

Fixes: #65782

Remove messageerror listeners before emitting the worker exit event.

Signed-off-by: Muhammed Kılıç <[email protected]>
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. worker Issues and PRs related to the worker_threads module and Worker API. labels Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. worker Issues and PRs related to the worker_threads module and Worker API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

worker: messageerror listeners remain during exit

2 participants