inspector: report all workers#28872
inspector: report all workers#28872eugeneo wants to merge 5 commits intonodejs:masterfrom eugeneo:flat-workers
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.
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.
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.
Can you rename this to child or childWorker to be more explicit?
|
|
||
| let rootWorker = null; | ||
|
|
||
| function runTest() { |
There was a problem hiding this comment.
const runTest = common.mustCall(() => { ..., to make sure that this is actually run?
| let reportedWorkersCount = 0; | ||
| const session = new Session(); | ||
| session.connect(); | ||
| session.on('NodeWorker.attachedToWorker', ({ params: { workerInfo } }) => { |
There was a problem hiding this comment.
ditto here, common.mustCall(..., MAX_DEPTH) for the event handler to make sure this actually runs as often as expected?
|
I didn't investigate to confirm, but the CI results look like there are relevant failures when running tests from workers (with |
Trott
left a comment
There was a problem hiding this comment.
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