-
Notifications
You must be signed in to change notification settings - Fork 5k
node:diagnostics_channel: sync with Node 26 + subsystem channels #32628
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
Open
cirospaciari
wants to merge
59
commits into
main
Choose a base branch
from
claude/diagnostics-channel-node26
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 50 commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
64a7c4e
node:diagnostics_channel: sync with Node 26 and add subsystem channels
cirospaciari dc25df3
require: publish the module.require diagnostics tracing channel
cirospaciari e6751a9
node:v8: implement queryObjects()
cirospaciari 82b4d13
module loader: publish the module.import diagnostics tracing channel
cirospaciari 4fbcc5c
Fix unchecked exception in the module.import wrapper
cirospaciari 55bc058
net: create the diagnostics channels at module scope
cirospaciari e6ec58c
expectations: quarantine test-net-connect-memleak.js on musl runners
cirospaciari 7e07ce4
expectations: quarantine two node-api suites on the ASAN runners
cirospaciari ee6a68d
napi tests: make test_function/test_instance_data robust under conser…
robobun 4c17997
Merge remote-tracking branch 'origin/main' into claude/diagnostics-ch…
cirospaciari c0f91f7
diagnostics_channel: drop expectations entries and cover http.server.…
cirospaciari 864835d
Remove stray empty file committed during the merge
cirospaciari 39d39c1
worker_threads/child_process: create the diagnostics channels at modu…
cirospaciari 9d460cf
Merge branch 'main' into claude/diagnostics-channel-node26
cirospaciari 0baaa6d
Address review nits: fix always-true dc guard, capture DisposableStac…
robobun 18bf408
diagnostics_channel: drop upstream TODO comments from tracePromise re…
robobun b3d66cd
http.server.* channels: decide upgrade before constructing the response
robobun 075d209
moduleLoaderImportModule: root the captured module-name string with a…
robobun 16ae013
NodeV8Module.h: add #pragma once and use root.h like sibling headers
robobun 3134afa
Merge remote-tracking branch 'origin/main' into claude/diagnostics-ch…
robobun d28684e
Merge branch 'main' into claude/diagnostics-channel-node26
robobun 6f4bd8b
ci: retrigger
robobun 0247903
net.server.listen: publish asyncEnd before unref, strengthen upgrade …
robobun a79591c
http.server.response.created: publish from dispatch path, restore sho…
robobun 4751648
Merge remote-tracking branch 'origin/main' into claude/diagnostics-ch…
robobun e25d142
cleanupAsyncHooksData: drain the nextTick queue when it exists
robobun 76f7eed
test: match file convention for subprocess stderr assertion
robobun 895dc9d
Merge branch 'main' into claude/diagnostics-channel-node26
cirospaciari b9d94a8
http.server.response.finish: attach a shared listener instead of per-…
robobun 34febeb
napi harness: capture stdout in runAsync too
robobun fc583af
Merge branch 'main' into claude/diagnostics-channel-node26
cirospaciari cf1178b
test: widen mimalloc page-count bound for JSC heap noise, matching main
cirospaciari b885814
Merge remote-tracking branch 'origin/main' into claude/diagnostics-ch…
robobun 152ef93
Merge remote-tracking branch 'origin/main' into claude/diagnostics-ch…
robobun ba6586a
test(async_hooks): give the four http/http2 frame-clear subprocess te…
robobun 3fbc875
expectations: quarantine test-net-connect-memleak.js on linux-x64
robobun c47b0af
Merge remote-tracking branch 'origin/main' into claude/diagnostics-ch…
robobun 6d4f0b2
test(async_hooks): document why the four frame-clear subprocess tests…
robobun c5313fb
diagnostics_channel: vendor the two http channel tests (+2) (#34641)
cirospaciari c732c17
Merge remote-tracking branch 'origin/main' into claude/diagnostics-ch…
robobun 078e4bb
Address review: swap require() on subscribe, lazy dc load in subsyste…
robobun f4383c0
[autofix.ci] apply automated fixes
autofix-ci[bot] 0ee0735
Address three nits: capture-once baseRequire, fix stale test comment
robobun 63640b2
Remove stray untracked Rust files accidentally added in 0ee07357cd
robobun b879723
http.Server.listen() publishes on net.server.listen like Node
robobun a5311d4
[autofix.ci] apply automated fixes
autofix-ci[bot] 43449e1
Merge remote-tracking branch 'origin/main' into claude/diagnostics-ch…
robobun 1f00d24
ci: retrigger
robobun a1d5c11
Merge branch 'main' into claude/diagnostics-channel-node26
dylan-conway e1ed259
Merge branch 'main' into diagnostics-channel-node26
cirospaciari cc52550
tracingChannel(null): throw ERR_INVALID_ARG_TYPE like Node
robobun f17681e
Merge remote-tracking branch 'origin/main' into claude/diagnostics-ch…
robobun 4eb58ac
v8.queryObjects: read options.format with ?? like Node
robobun 1c8fc53
Revert "v8.queryObjects: read options.format with ?? like Node"
robobun 3b8b93a
Merge branch 'main' into diagnostics-channel-node26
cirospaciari b7ac433
Trim comments to node-source/spec references
robobun 0ea7f36
require: forward the two named params with $call instead of $apply(ar…
robobun 6ef2005
Address review nits: 1-arg require fast path, stale expectations entr…
robobun 416dd52
http1 fallback path publishes the http.server.* channels
robobun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| // Wires the "module.require" / "module.import" diagnostics tracing channels | ||
| // into the CommonJS require path and dynamic import(). node:diagnostics_channel | ||
| // calls install() on load; nothing here runs until it does, and the loaders | ||
| // themselves carry no per-call check. | ||
|
|
||
| const setHasModuleImportSubscribers = $newCppFunction( | ||
| "NodeDiagnosticsChannel.cpp", | ||
| "jsSetHasModuleImportSubscribers", | ||
| 1, | ||
| ); | ||
|
|
||
| let requireChannel; | ||
| let importChannel; | ||
| // The unwrapped overridableRequire (captured on first install so a user's own | ||
| // Module.prototype.require override is what we wrap and restore). | ||
| let baseRequire; | ||
| let requireWrapped = false; | ||
|
|
||
| function tracingRequire(this: any, originalId: string, options?: { paths?: string[] }) { | ||
| if (requireChannel !== undefined && requireChannel.hasSubscribers) { | ||
| return requireChannel.traceSync( | ||
| baseRequire, | ||
| { __proto__: null, parentFilename: this.filename, id: originalId }, | ||
| this, | ||
| originalId, | ||
| options, | ||
| ); | ||
| } | ||
| return baseRequire.$call(this, originalId, options); | ||
| } | ||
| Object.defineProperty(tracingRequire, "name", { value: "require" }); | ||
|
|
||
| function onRequireSubscribersChanged() { | ||
| const has = requireChannel !== undefined && requireChannel.hasSubscribers; | ||
| if (has === requireWrapped) return; | ||
| const Module = require("node:module"); | ||
| if (has) { | ||
| // Capture once: a user wrapper installed between subscribe cycles may | ||
| // delegate to tracingRequire, so re-capturing it here would recurse. | ||
| baseRequire ??= Module.prototype.require; | ||
| Module.prototype.require = tracingRequire; | ||
| requireWrapped = true; | ||
| } else { | ||
| // Only unwrap what we wrapped; a user override installed while tracing was | ||
| // active stays. | ||
| if (Module.prototype.require === tracingRequire) { | ||
| Module.prototype.require = baseRequire; | ||
| } | ||
| requireWrapped = false; | ||
| } | ||
| } | ||
|
|
||
| function onImportSubscribersChanged() { | ||
| setHasModuleImportSubscribers(importChannel !== undefined && importChannel.hasSubscribers); | ||
| } | ||
|
|
||
| const moduleTracing = { | ||
| // Called from tryTraceModuleImport (C++) only when the import flag is set; | ||
| // `doImport` performs the dynamic import and returns its promise. | ||
| traceImport(doImport, parentURL, url) { | ||
| if (importChannel === undefined || !importChannel.hasSubscribers) { | ||
| return doImport(); | ||
| } | ||
| return importChannel.tracePromise(doImport, { __proto__: null, parentURL, url }); | ||
| }, | ||
| // Called once from node:diagnostics_channel on load. Hooks every sub-channel | ||
| // so gaining/losing a subscriber on any of them re-evaluates the swap. | ||
| install(requireCh, importCh, hookSubscriberChange) { | ||
| requireChannel = requireCh; | ||
| importChannel = importCh; | ||
| hookSubscriberChange(requireCh, onRequireSubscribersChanged); | ||
| hookSubscriberChange(importCh, onImportSubscribersChanged); | ||
| // In case something subscribed before install() ran. | ||
| onRequireSubscribersChanged(); | ||
| onImportSubscribersChanged(); | ||
| }, | ||
| }; | ||
|
|
||
| export default moduleTracing; | ||
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.