-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Discussion: Criteria for upgrading worker_threads module from experimental to stable #22940
Comments
Question: Is the API more or less frozen? |
Would be nice to see locks be stable by then too, but maybe that's a separate thing to track? |
@devsnek I’d track that separately, given that it’s a fully separate API and is useful independently of Workers? |
From Node's side it's still experimental so I believe it's not frozen, but it's related to Web Workers which has a stable spec and we (kind of? correct me if I am wrong) agreed in nodejs/TSC#557 that we don't want to deviate too far from the existing design. |
Fwiw, there’s also the issue of workers not playing well with fs stat watchers because their cleanup code calls its callback prematurely on the libuv side (libuv/libuv#1869) … should things like that go on the list? |
I guess if we don't want it to be stable before that's fixed, then yes. |
just reading the microjob readme... I think another thing to block on is better documentation. people should be re-using threads as much as possible. |
Does the inspector work already? (I was away and didn't notice) Would also be interested in getting sockets transferable - @KromDaniel has expressed interest in working on that (although I'm definitely not blocking on this) |
It should, yes. :)
I wouldn’t list that as a criterion here, but I’d also love to see that! Adressing libuv/libuv#390 would be the “hard” part here. |
https://github.com/mvcbox/node-function-thread is interesting as well for running a single function in a thread. Perhaps not low-level enough and could be rewritten to use the new APIs. |
One thing I saw in one of the original discussions was that the module couldn't be called cc @romansky: would you be open to letting the Node.js project use the package name |
I'd like it if there could be an assessment done from a web compatibility and tooling perspective wrt to workflows around writing universal multi-threaded code. I imagine it would be straightforward to write a browser wrapper for I completely understand too if this is already decided as a non-goal as well, and will gladly have that discussion too. If I've missed any of these points in previous discussions please do point out where I can read further. |
I'd be happy for you to have it. Let me know how to do the transfer
…On Fri, Oct 5, 2018, 2:27 AM empyrical ***@***.***> wrote:
One thing I saw in one of the original discussions was that the module
couldn't be called worker because the owner of that package name on NPM
wanted to keep the name. Would workers be an acceptable option? Before
moving out of experimental might be a good time to change the name to
something shorter (and leaving worker_threads as an alias to the new
name, because there are already user modules that use it)
cc @romansky <https://github.com/romansky>: would you be open to letting
the Node.js project use the package name workers for this? (
https://www.npmjs.com/package/workers )
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#22940 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAlqAWU16g9omNZz6eIGTjJmT6pZhKzUks5uhplrgaJpZM4Wva44>
.
|
@romansky are you coming to Reversim on Monday by any chance (saw Hasadna in orgs <3)? If so - can I buy you coffee to thank you in person? |
Thank you Benhamin! I'm traveling on Tuesday so not sure about Monday..
…On Sun, Oct 7, 2018 at 10:24 AM Benjamin Gruenbaum ***@***.***> wrote:
@romansky <https://github.com/romansky> are you coming to Reversim on
Monday by any chance (saw Hasadna in orgs <3)? If so - can I thank you in
person?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#22940 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAlqAY89kw4NnyCxIreMtMWXDSzG5wbfks5uiaw_gaJpZM4Wva44>
.
--
---
"Make everything as simple as possible, but not simpler."
- Albert Einstein
|
@romansky ok, if you'd like to get coffee I'll be there (likely with a Node shirt) - so if you're up for it reach out (it's welcome) and if not some other time :) |
Aren't we supposed to use the |
(I was just happy about the gesture - not voicing an opinion about actually using the name either way) |
@romansky You can add someone as an owner to your module from the CLI like this:
Replace Also, I guess discussion whether or not the package should be renamed could be done as a new issue |
+100 for |
@benjamingr I added you as a maintainer via the UI, hope that is what you
are looking for. Feel free to use it and of-course remove me as a member
for that NPM package.
…On Sun, Oct 7, 2018 at 9:08 PM Gus Caplan ***@***.***> wrote:
+100 for @nodejs prefix
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#22940 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAlqAbdRG8dqFOeXwMdo8-YOYUvK-ceqks5uikMmgaJpZM4Wva44>
.
--
---
"Make everything as simple as possible, but not simpler."
- Albert Einstein
|
Thanks @romansky ! benjamingr is me but it's an old account I don't have access to - I use |
Hi everyone, I would like to inform you that worker_threads landed in node-worker-nodes some time ago ( allegro/node-worker-nodes#29 ) and was successfully tested in a large scale environment (Allegro is the biggest online marketplace in Poland). I would also like to work on some of the issues mentioned here (mostly full test coverage and fixing flaky tests) as a part of hacktoberfest and I would welcome mentorship on those issues. |
Permissions granted!
…On Thu, Oct 11, 2018 at 6:05 PM Benjamin Gruenbaum ***@***.***> wrote:
Thanks @romansky <https://github.com/romansky> !
benjamingr *is* me but it's an old account I don't have access to - I use
benjamin.gruenbaum or add Anna (https://www.npmjs.com/~addaleax) or the
foundation account ( https://www.npmjs.com/~nodejs-foundation ) :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#22940 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAlqAV-Ge8BWEqqHWl2_m6q0tbn5joKCks5uj15DgaJpZM4Wva44>
.
--
---
"Make everything as simple as possible, but not simpler."
- Albert Einstein
|
I already have that set, passing it to the node process as in your first example. I thought maybe something had to be done when spawning the workers. I remember when using the |
@nodejs/v8 Any ideas on when the |
@hashseed Maybe you could figure out more about the state of |
(Maybe @jeremyroman?) |
I don't think the ValueSerializer is to be considered experimental. It is used in production code and undergoes fuzz testing. Also, sorry for the late response. Somehow slipped my inbox. |
@hashseed I think Anna was asking because of the warning comments in https://github.com/v8/v8/blob/cc7ac98b0c02ea6c98035194c86068cb873dd106/include/v8.h#L2007-L2015 https://github.com/v8/v8/blob/cc7ac98b0c02ea6c98035194c86068cb873dd106/include/v8.h#L2131-L2139 |
Yeah – I’m happy to submit a CL to remove it, if it’s no longer accurate (the last API change was over a year ago, so I think that should be okay?). Edit: Opened https://chromium-review.googlesource.com/c/v8/v8/+/1461999 after Yang’s comment below. |
Please submit a CL. I'll get the right people to review this. |
Replied on that CL; LGTM. |
I'd like to add #25933 to the list. |
@trevnorris #25933 is a problem that is only partially specific to Workers, so I would be reluctant to put it on the list. V8 (and therefore Node.js) has no good handling for out-of-memory situations and can crash as a consequence of that – with or without Workers. |
@addaleax At first I questioned whether this should be on the list, but after considering how it's affecting Workers I decided it should be added. After the Worker is initialized and the user's code is running there is the option to hook into There is no method to check whether a Worker will abort before it's created, e.g. simply looking at available memory isn't sufficient (such as my |
That doesn’t get us much, as this also leads to unconditional aborts when it is called.
My point was that this is true for every other type of Node.js object as well, Workers might just be one of the more resource-intensive ones. |
FYI: nodejs/build#1840 (comment), test-worker-debug may be flaky on arm and need looking into. |
Any plans to upgrade to stable? |
@kaushalyap In May at our Collaborator Summit we agreed that the remaining criterion before upgrading to stable would be making sure that our Web Messaging implementation matches with the Web Platform Tests for those, so I think at this point it’s only fixing #29315 to work on Windows and then we’re good to go. (It’s probably not a lot of work, but debugging on Windows sadly still takes a lot of time and effort, at least for me.) |
This feature is not expected to receive breaking changes to its API and is used in real-world applications. As discussed at the last collaborator summit (Berlin May 2019), the `worker_threads` module can be considered stable once our Web Messaging implementation is compatible with Web Platform Tests. As of b34f05e, that is the case. Fixes: nodejs#22940
Hi all, I am not entirely sure how to ask this, but still worth the try: When I am trying to profile an app using V8 profiler, the job executed on worker_threads does not show up in the profiles. I am using this lib: https://github.com/hyj1991/v8-profiler-next which exposes node bindings inside JS. |
@carera hey, first of all thank you for chiming in :] In hyj1991/v8-profiler-next#9 (comment) it appears that slonka has confirmed that worker_threads are supported. I have also been able to profile them in the past when testing PRs related to them. Just wondering - why are you invoking the profiler directly rather than going through the inspector and the debugger protocol? You should be able to open an inspector and do something like I think (I don't remember precisely but remember vaguely from reviewing but I can happily check for you) there should be something like a There are a few things to keep in mind:
Mostly - we have been waiting for people to be engaged and raise what they want and use cases. |
Thank you for your swift response, @benjamingr. The use case we have is the ability to profile on demand in production without the need of running the service with any |
@carera You would open the inspector dynamically, then call |
Thank you @benjamingr again! I am not entirely sure how does |
@carera ndb just has built in support for debugging worker threads. You would send a |
This feature is not expected to receive breaking changes to its API and is used in real-world applications. As discussed at the last collaborator summit (Berlin May 2019), the `worker_threads` module can be considered stable once our Web Messaging implementation is compatible with Web Platform Tests. As of b34f05e, that is the case. Fixes: #22940 PR-URL: #29512 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
This feature is not expected to receive breaking changes to its API and is used in real-world applications. As discussed at the last collaborator summit (Berlin May 2019), the `worker_threads` module can be considered stable once our Web Messaging implementation is compatible with Web Platform Tests. As of b34f05e, that is the case. Fixes: #22940 PR-URL: #29512 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
worker_threads
in teststerminate()
ValueSerializer
in particular)/cc @nodejs/workers
The text was updated successfully, but these errors were encountered: