Repository navigation
Conversation
|
e2e same like: #62915 (comment) |
|
Review requested:
|
7865a8d to
4bd2033
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #64369 +/- ##
========================================
Coverage 90.49% 90.50%
========================================
Files 797 797
Lines 277598 277899 +301
Branches 53336 53405 +69
========================================
+ Hits 251220 251515 +295
+ Misses 16790 16789 -1
- Partials 9588 9595 +7
🚀 New features to boost your workflow:
|
929ddfe to
eaa29a9
Compare
d499741 to
8fa14bc
Compare
|
I think it's time to conduct a re-review. Thank you. @metcoder95 @ShogunPanda @mcollina |
|
push |
|
push |
|
Friendly ping on the next step. The existing review feedback has been addressed, @metcoder95 has approved, and the PR is currently mergeable. It is still labeled "needs-ci" — could a collaborator please trigger the full CI? If CI is green, could @nodejs/http and @nodejs/inspector give it a final look or let me know if anything else is needed before landing? Happy to address any follow-up feedback promptly. Thanks! |
|
push |
|
push... @jasnell Can you help me add the label to run the CI |
0cb2dec to
71b18a4
Compare
|
Hi @mcollina , I’ve rebased #64369 onto the latest main and resolved the HTTP outgoing conflict. The PR is mergeable again, and CI is running. The targeted HTTP/Inspector tests pass locally. When you have a chance, could you review the HTTP integration, particularly the request-body tracking and raw response-body hook? I’d appreciate your feedback and will address any comments promptly. Thanks! |
|
Can you do a run of the benchmarks? |
I tried comparing the main branch and found that the newly added features resulted in a performance drop of around 18%. Due to the collection of body data, this decrease is actually within expectations. But did CI just fail? I think while investigating, I can also see if there are any ways to optimize.
I can’t access the Jenkins results due to the CI read permissions. Both node-test-commit/92841 and node-test-pull-request/78032 failed, although the reported platform checks appear green. Could someone with CI access share the failing job/platform, test name, and relevant console output? If the failure is unrelated to this change, could you please rerun the affected job? Thanks! @mcollina |
|
I reduced the inspection overhead by encoding initiator stacks directly into CBOR, removing a redundant request-body copy, and simplifying the body-completion notification. Async caller frames and validation checks are preserved. With Network inspection enabled on both sides, local benchmarks showed an 8.1%–9.7% throughput improvement over the previous implementation; throughput remains approximately 10%–11% below the main baseline. Regression tests and the remote Inspector E2E passed locally. |
|
@mcollina plz cc again. |
|
@leah-1ee I noticed you're online. Could you help me kick off CI? I'm basically ready and need to move forward at the moment. |
|
I'd be happy to help, but I don't have permission to trigger CI. I think you'll need to ask a collaborator. |
Thanks for getti. This is really tough to move forward with 😭 I really need a way to stay in touch with them reliably |
|
@trivikr I noticed you're online. Could you help me kick off CI? I'm basically ready and need to move forward at the mome |
|
@joyeecheung I noticed you're online. Could you help me kick off CI?... |
|
Hi @mcollina @metcoder95, I'd like to ask for some help getting #64369 through the final review and landing process. This work originally started in #62915 back in April and was resubmitted as #64369 in July. I appreciate the reviews and feedback so far. Current status:
Could a collaborator help clarify the remaining steps?
If there are still technical concerns, I'm happy to address them. I'd also appreciate guidance on whether the scope should be split into smaller PRs. After several months of work and multiple review rounds, I'd really like to understand what is still blocking this contribution and establish a clear path toward landing. Thanks again for your time and help! |
|
Hi @legendecas @jasnell @islandryu, I'd also really appreciate your help with #64369, given your experience with Node.js's Network Inspector implementation and the underlying request/response buffering mechanisms. I've summarized the current status and remaining blockers in my comment above. At this point, I'm hoping to get a final technical assessment, particularly regarding the implementation approach and performance trade-offs. Would one of you be willing to take another look and potentially help shepherd this PR through the remaining review, CI, and landing steps? This contribution has been in progress since April, and I'd genuinely appreciate any guidance on what is still needed to get it across the finish line. I'm fully committed to addressing any remaining concerns. Thanks so much for your time and for all the work you do on Node.js! |
This comment was marked as outdated.
This comment was marked as outdated.
|
Thank you very much for replying to me and letting me know how to proceed next! Thank you!
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
I re-ran Jenkins and it was successful. It seems that the linting failure was indeed a flake. Note that GitHub is currently suffering from an incident https://www.githubstatus.com/incidents/smtdswd1h2w4 (and caused the first Jenkins re-run to fail with "fatal: Could not read from remote repository.") The next step is for a collaborator familiar with this subject matter to review the latest commit, approve it, then land it. |
Thank you, sir. I have been troubled by this for a long time, and I never expected to make such rapid progress after meeting you. Thank you |
|
Correction: The linting error was due to a bug in #66837 which has been corrected. Jenkins CI rebases on |
That sounds like good news - it means the issue isn't due to this PR, so we can move forward more smoothly |
|
The gating factor is the availability of a collaborator to review, approve and land your PR. |
|
@mcollina @legendecas @jasnell The CI (including Jenkins) for this PR has been completed. Please help review the code. Thank you |
This seems non-trivial. Which benchmark did you run? |
Hello~ Thank you for taking the time to review this PR! Let me explain why I consider some additional overhead expected, and how I ran the benchmarks. First, the approximately 18% figure in my earlier comment predates the optimizations. The latest recorded local benchmark results show a 10.0%–11.0% throughput reduction compared with the main baseline, with Network inspection enabled on both sides. The additional overhead is expected because the PR extends the work performed during inspection: it retains request-body data for I used Node’s existing
The results after optimization were:
The optimizations improved throughput by 8.1%–9.7% over the previous implementation, through direct CBOR encoding of initiator stacks, removal of a redundant request-body copy, and simplification of body-completion notification. Separately, the inspection-disabled HTTP benchmarks in the original run showed no statistically significant regression. These measurements were taken on September 30, before the later rebases. I have retained the benchmark commands, preload script, and raw CSV results for reproducibility. |
|
@marcastben-hash Thanks for reviewing the HTTP integration. These are useful points. My preference would be to address them in focused follow-up PRs rather than make all four prerequisites for landing, if the HTTP and Inspector maintainers are comfortable with that.
My expectation is that these additions are unlikely to cause a substantial regression, though that needs measurement. A server benchmark with inspection disabled, covering response writes and incoming request bodies, would be the right way to verify this on the current revision. I would prefer to handle that measurement and any resulting optimization in a focused follow-up. |
|
Sorry if I was not clear. I was curious about the performance cost on regular mode, that is when inspector not enabled, and how much cost do these new changes incur? |

Summary
This PR supersedes #62915 with the same feature work rebased onto current
main.It adds builtin
http/httpsrequest-body support to network inspection, soNetwork.getRequestPostDatacan return text request bodies while preserving the existing rejection behavior for binary request bodies.It also moves builtin
httpresponse-body tracking to a raw-byte hook beforeIncomingMessagedecoding, so response inspection remains correct even when user code callsresponse.setEncoding(...).In addition, this PR lets
Network.requestWillBeSentcarry JS-provided initiator data captured at request construction time. The C++ inspector side validates structuredinitiator.stackobjects against the inspector protocol schema before forwarding them to DevTools.Problem
Builtin
http/httpsnetwork inspection currently emits request and response lifecycle events, but the builtin client path does not expose request-body bytes to the inspector. As a result,Network.getRequestPostDatacannot return POST data for builtinhttp/httpsrequests.There are two related gaps:
IncomingMessage'data'events are not a stable raw-byte source. If user code callsresponse.setEncoding('utf8'), chunks observed through userland become strings, while the inspector protocol expects byte-oriented payloads.requestWillBeSentuntil request-body state is known means a C++ stack captured at emission time would point into Node.js internals rather than the user call site. The initiator needs to be captured when the request is created and validated before being emitted.Approach
Network.dataSent(...) -> NetworkAgent::getRequestPostData(...)buffering pipeline instead of changing the CDP schema.http.client.request.bodyChunkSenthttp.client.request.bodySenthttp.client.response.bodyChunkReceivedrequestWillBeSentuntil body state is known, sohasPostDatais accurate for both body and body-less requests.initiator.stackwith generated inspector protocol schema support in C++.Behavior
After this change:
httpandhttpsPOST requests with UTF-8 text bodies are available throughNetwork.getRequestPostDatahttpresponse inspection continues to work even if user code callsresponse.setEncoding('utf8')Network.requestWillBeSentreports accuratehasPostDataNetwork.requestWillBeSentcan carry JS-captured initiator stack data from the request construction siteTests
This PR adds and extends coverage in:
test/parallel/test-diagnostics-channel-http.jstest/parallel/test-inspector-network-http.jstest/parallel/test-inspector-emit-protocol-event.jstest/parallel/test-inspector-emit-protocol-event-errors.jsThe updated tests cover:
write()andend()httpandhttpsNetwork.getRequestPostDataresponse.setEncoding('utf8')hasPostDatafor body-less requestsVerification
Validated with the targeted test suite:
Also validated manually with an end-to-end inspector run:
Refs