Uh oh!
There was an error while loading. Please reload this page.
worker: handle detached MessagePort from a different context - #49150
Merged
Conversation
juanarbolforce-pushed
the
juan/fix-worker-issue
branch
3 times, most recently
from
August 13, 2023 20:19
36978ae to
f100bf8Comparenodejs-github-bot
commented
Aug 13, 2023
Collaborator
This was referenced Aug 14, 2023
juanarbol
commented
Aug 19, 2023
MemberAuthor
Cc @nodejs/workers 😅 |
Uh oh!
There was an error while loading. Please reload this page.
juanarbolforce-pushed
the
juan/fix-worker-issue
branch
from
August 23, 2023 21:00
f100bf8 to
1d8f4eaComparejuanarbol
commented
Aug 23, 2023
MemberAuthor
@addaleax PTAL |
nodejs-github-bot
commented
Aug 23, 2023
Collaborator
addaleax
approved these changes
Aug 24, 2023
Uh oh!
There was an error while loading. Please reload this page.
juanarbol
commented
Aug 24, 2023
juanarbol
left a comment
MemberAuthor
There was a problem hiding this comment.
Thanks for reviewing this!
juanarbolforce-pushed
the
juan/fix-worker-issue
branch
from
August 24, 2023 15:31
1d8f4ea to
4462700Comparejuanarbol
commented
Aug 24, 2023
MemberAuthor
@addaleax PTAL |
nodejs-github-bot
commented
Aug 24, 2023
Collaborator
nodejs-github-bot
commented
Aug 24, 2023
Collaborator
22 tasks
nodejs-github-bot
commented
Sep 4, 2023
Collaborator
nodejs-github-bot
commented
Sep 4, 2023
Collaborator
19 tasks
nodejs-github-bot
commented
Sep 5, 2023
Collaborator
nodejs-github-bot
commented
Sep 5, 2023
Collaborator
25 tasks
nodejs-github-bot
commented
Sep 6, 2023
Collaborator
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 |
MemberAuthor
Can anyone from @nodejs/workers review this one? Please, haha |
This was referenced Sep 7, 2023
anonrig
approved these changes
Oct 22, 2023
nodejs-github-bot
commented
Oct 22, 2023
Collaborator
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>
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>
This file contains hidden or 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
Sign up for freeto 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.moveMessagePortToContextis 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.