worker: handle detached `MessagePort` from a different context by juanarbol · Pull Request #49150 · nodejs/node

@nodejs-github-bot added c++

Issues and PRs that require attention from people who are familiar with C++.

needs-ci

PRs that need a full CI run.

labels

Aug 13, 2023

@juanarbol juanarbol added worker

Issues and PRs related to Worker support.

request-ci

Add this label to start a Jenkins CI on a PR.

and removed request-ci

Add this label to start a Jenkins CI on a PR.

labels

Aug 13, 2023

This was referenced

Aug 14, 2023

addaleax

addaleax

juanarbol

This was referenced

Sep 7, 2023

targos pushed a commit that referenced this pull request

Oct 23, 2023
When `worker.moveMessagePortToContext` is used, the async handle
associated with the port, will be triggered more than needed (at least
one more time) and with null data. That can be avoided by simply
checking that the data is present and the port is not detached.

Fixes: #49075
Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
PR-URL: #49150
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>

alexfernandez pushed a commit to alexfernandez/node that referenced this pull request

Nov 1, 2023
When `worker.moveMessagePortToContext` is used, the async handle
associated with the port, will be triggered more than needed (at least
one more time) and with null data. That can be avoided by simply
checking that the data is present and the port is not detached.

Fixes: nodejs#49075
Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
PR-URL: nodejs#49150
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>

targos pushed a commit that referenced this pull request

Nov 11, 2023
When `worker.moveMessagePortToContext` is used, the async handle
associated with the port, will be triggered more than needed (at least
one more time) and with null data. That can be avoided by simply
checking that the data is present and the port is not detached.

Fixes: #49075
Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
PR-URL: #49150
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>