-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
worker: handle detached MessagePort
from a different context
#49150
Merged
nodejs-github-bot
merged 1 commit into
nodejs:main
from
juanarbol:juan/fix-worker-issue
Oct 22, 2023
Merged
worker: handle detached MessagePort
from a different context
#49150
nodejs-github-bot
merged 1 commit into
nodejs:main
from
juanarbol:juan/fix-worker-issue
Oct 22, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
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
juanarbol
force-pushed
the
juan/fix-worker-issue
branch
3 times, most recently
from
August 13, 2023 20:19
36978ae
to
f100bf8
Compare
github-actions
bot
removed
the
request-ci
Add this label to start a Jenkins CI on a PR.
label
Aug 13, 2023
This was referenced Aug 14, 2023
Cc @nodejs/workers 😅 |
addaleax
reviewed
Aug 23, 2023
juanarbol
force-pushed
the
juan/fix-worker-issue
branch
from
August 23, 2023 21:00
f100bf8
to
1d8f4ea
Compare
@addaleax PTAL |
github-actions
bot
removed
the
request-ci
Add this label to start a Jenkins CI on a PR.
label
Aug 23, 2023
addaleax
approved these changes
Aug 24, 2023
juanarbol
commented
Aug 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reviewing this!
juanarbol
force-pushed
the
juan/fix-worker-issue
branch
from
August 24, 2023 15:31
1d8f4ea
to
4462700
Compare
@addaleax PTAL |
github-actions
bot
removed
the
request-ci
Add this label to start a Jenkins CI on a PR.
label
Aug 24, 2023
22 tasks
github-actions
bot
removed
the
request-ci
Add this label to start a Jenkins CI on a PR.
label
Sep 4, 2023
19 tasks
25 tasks
juanarbol
added
the
commit-queue
Add this label to land a pull request using GitHub Actions.
label
Sep 6, 2023
nodejs-github-bot
added
commit-queue-failed
An error occurred while landing this pull request using GitHub Actions.
and removed
commit-queue
Add this label to land a pull request using GitHub Actions.
labels
Sep 6, 2023
Commit Queue failed- Loading data for nodejs/node/pull/49150 ✔ Done loading data for nodejs/node/pull/49150 ----------------------------------- PR info ------------------------------------ Title worker: handle detached `MessagePort` from a different context (#49150) Author Juan José (@juanarbol) Branch juanarbol:juan/fix-worker-issue -> nodejs:main Labels c++, worker, needs-ci Commits 1 - worker: handle detached `MessagePort` from a different context Committers 1 - Juan José Arboleda PR-URL: https://github.com/nodejs/node/pull/49150 Fixes: https://github.com/nodejs/node/issues/49075 Reviewed-By: Anna Henningsen ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/49150 Fixes: https://github.com/nodejs/node/issues/49075 Reviewed-By: Anna Henningsen -------------------------------------------------------------------------------- ⚠ Commits were pushed since the last approving review: ⚠ - worker: handle detached `MessagePort` from a different context ℹ This PR was created on Sun, 13 Aug 2023 19:44:53 GMT ✔ Approvals: 1 ✔ - Anna Henningsen (@addaleax): https://github.com/nodejs/node/pull/49150#pullrequestreview-1593181662 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2023-09-05T16:34:36Z: https://ci.nodejs.org/job/node-test-pull-request/53747/ - Querying data for job/node-test-pull-request/53747/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/6092861198 |
Can anyone from @nodejs/workers review this one? Please, haha |
This was referenced Sep 7, 2023
anonrig
approved these changes
Oct 22, 2023
juanarbol
added
commit-queue
Add this label to land a pull request using GitHub Actions.
and removed
commit-queue-failed
An error occurred while landing this pull request using GitHub Actions.
labels
Oct 22, 2023
nodejs-github-bot
removed
the
commit-queue
Add this label to land a pull request using GitHub Actions.
label
Oct 22, 2023
Landed in c206b2a |
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>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Note aside, this could be fixed as well by the next diff:
IMO that could change how the workers behave, then I prefer a "handle case" approach.