Skip to content
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

src: handle empty Maybe in uv binding initialize #25079

Closed
wants to merge 1 commit into from

Conversation

addaleax
Copy link
Member

This can fail when terminating a Worker that loads
the uv binding at the same time.

Refs: #25061 (comment)

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

This can fail when terminating a Worker that loads
the `uv` binding at the same time.

Refs: nodejs#25061 (comment)
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. libuv Issues and PRs related to the libuv dependency or the uv binding. labels Dec 17, 2018
@danbev
Copy link
Contributor

danbev commented Dec 17, 2018

@Trott Trott added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 17, 2018
@addaleax
Copy link
Member Author

Landed in 67f9582

@addaleax addaleax closed this Dec 19, 2018
@addaleax addaleax deleted the uv-binding-map-set branch December 19, 2018 16:33
addaleax added a commit that referenced this pull request Dec 19, 2018
This can fail when terminating a Worker that loads
the `uv` binding at the same time.

Refs: #25061 (comment)
Fixes: #25134
PR-URL: #25079
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@joyeecheung
Copy link
Member

joyeecheung commented Dec 19, 2018

Does this mean we need to treat bindings loaded in workers with care for situations like this? (And this one fails more often because the error map creation is a lot of code when expanded?)

(Also I think we should be able to build that lazily...)
(EDIT: oh no, we also have the constants defined on the binding that are probably relied on by the users...)

@addaleax
Copy link
Member Author

@joyeecheung I think the reason for this is that Map operations call into builtin function, i.e. it is similar to calling JS.

I mean, I would personally prefer to always code more defensively, but I assume people have differing opinions on this…

@joyeecheung
Copy link
Member

@addaleax I think it makes sense to be more defensive at least for the binding initializers - if I understand correctly, workers are special because now you have the ability to terminate a thread while it's bootstrapping (whereas previously things were more deterministic on the main thread?)

@addaleax
Copy link
Member Author

@joyeecheung Yes, exactly. I still plan to go through all of our source code and look for problematic cases… which is, unfortunately, a lot of code to go through 😄

MylesBorins pushed a commit that referenced this pull request Dec 25, 2018
This can fail when terminating a Worker that loads
the `uv` binding at the same time.

Refs: #25061 (comment)
Fixes: #25134
PR-URL: #25079
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Dec 25, 2018
refack pushed a commit to refack/node that referenced this pull request Jan 14, 2019
This can fail when terminating a Worker that loads
the `uv` binding at the same time.

Refs: nodejs#25061 (comment)
Fixes: nodejs#25134
PR-URL: nodejs#25079
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@Trott

This comment has been minimized.

Trott pushed a commit to Trott/io.js that referenced this pull request Jul 26, 2019
This can fail when terminating a Worker that loads
the `uv` binding at the same time.

Refs: nodejs#25061 (comment)
Fixes: nodejs#25134
PR-URL: nodejs#25079
Backport-PR-URL: nodejs#28832
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@Trott
Copy link
Member

Trott commented Jul 26, 2019

Fixed up backport with suggestion from @addaleax and reopened it: #28832

BethGriggs pushed a commit that referenced this pull request Jul 30, 2019
This can fail when terminating a Worker that loads
the `uv` binding at the same time.

Refs: #25061 (comment)
Fixes: #25134
PR-URL: #25079
Backport-PR-URL: #28832
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. libuv Issues and PRs related to the libuv dependency or the uv binding.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants