-
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
inspector: report all workers #28872
Conversation
Main thread (the one that WS endpoint connects to) should be able to report all workers.
worker_agent_.reset(); // Dispose before the dispatchers | ||
if (worker_agent_) { | ||
worker_agent_->disable(); | ||
worker_agent_.reset(); // Dispose before the dispatchers |
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.
Btw, if you need member fields to be destroyed in a specific order, it might make the sense to re-order the fields so that that happens automatically?
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.
I would like to have this specified explicitly so I don't cause crashes by moving fields in the header file. Had that happen before :)
} | ||
|
||
function runWorkerThread() { | ||
let worker = null; |
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.
Can you rename this to child
or childWorker
to be more explicit?
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.
Done
|
||
let rootWorker = null; | ||
|
||
function runTest() { |
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.
const runTest = common.mustCall(() => { ...
, to make sure that this is actually run?
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.
Done
let reportedWorkersCount = 0; | ||
const session = new Session(); | ||
session.connect(); | ||
session.on('NodeWorker.attachedToWorker', ({ params: { workerInfo } }) => { |
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.
ditto here, common.mustCall(..., MAX_DEPTH)
for the event handler to make sure this actually runs as often as expected?
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.
Done
I didn't investigate to confirm, but the CI results look like there are relevant failures when running tests from workers (with |
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.
Putting in a request changes so no one lands this without noticing that there's a CI failure that needs to be addressed.
@Trott thanks for reminding! Those two tests should not run in a worker as child workers are now reported from the top level only. |
Looks like |
I took the liberty of committing the fix for that myself. Hope that's OK. If not, remove my commit and add your preferred change. |
This comment has been minimized.
This comment has been minimized.
Well, that's what I get for using the GitHub interface as an IDE. Let's try again... |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
CI passed! |
@Trott - thank you for fixing the tests! |
Main thread (the one that WS endpoint connects to) should be able to report all workers. PR-URL: nodejs#28872 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Landed in 7435dc8 |
Main thread (the one that WS endpoint connects to) should be able to report all workers. PR-URL: #28872 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Main thread (the one that WS endpoint connects to) should be able
to report all workers.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes