Skip to content

Conversation

@santigimeno
Copy link
Member

While also adding tracing channels to track http2 client and server streams lifetime.

@santigimeno santigimeno self-assigned this Feb 10, 2025
Copy link
Member

@RafaelGSS RafaelGSS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have much context to review this in-depth, but it seems very well-tested. Just left a couple of questions, code LGTM.

const onServerStreamFinishChannel = dc.channel('http2.server.stream.finish');
const onServerStreamCloseChannel = dc.channel('http2.server.stream.close');

const clientTracingChannels = dc.tracingChannel('http2.client');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const clientTracingChannels = dc.tracingChannel('http2.client');
const clientTracingChannels = dc.tracingChannel('http2.client');

Should we have a http2.server.session too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could, but at the moment I'm only tracking streams (http transactions). We could of course add support for sessions (to track actual connections). We can add those later on. At least this way we have the same support as we have for http and fetch.

if (headers[HTTP2_HEADER_METHOD] === HTTP2_METHOD_HEAD) {
// For head requests, there must not be a body...
// end the writable side immediately.
stream.end();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't it be inside an else if instead? What if we receive an endOfStream = true and HTTP2_HEADER_METHOD = head?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, to be honest I've just kept the same logic it was implemented before.

@santigimeno santigimeno force-pushed the santi/diag_http2_tracing branch from c554ce0 to abbaab0 Compare February 11, 2025 15:41
@santigimeno santigimeno changed the base branch from santi/diag_http2 to node-v22.x-nsolid-v5.x February 11, 2025 15:43
@santigimeno santigimeno force-pushed the santi/diag_http2_tracing branch from abbaab0 to c392d14 Compare February 11, 2025 19:58
@santigimeno santigimeno force-pushed the santi/diag_http2_tracing branch from c392d14 to 6e50225 Compare February 12, 2025 10:57
santigimeno added a commit that referenced this pull request Feb 12, 2025
PR-URL: #266
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
santigimeno added a commit that referenced this pull request Feb 12, 2025
PR-URL: #266
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
@santigimeno
Copy link
Member Author

Landed in 65430e7...ed8c4f9

@santigimeno santigimeno deleted the santi/diag_http2_tracing branch February 12, 2025 14:14
santigimeno added a commit that referenced this pull request Feb 12, 2025
PR-URL: #266
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
santigimeno added a commit that referenced this pull request Feb 12, 2025
PR-URL: #266
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
santigimeno added a commit that referenced this pull request Feb 14, 2025
PR-URL: #266
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
santigimeno added a commit that referenced this pull request Feb 14, 2025
PR-URL: #266
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
santigimeno added a commit that referenced this pull request Feb 14, 2025
PR-URL: #266
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
PR-URL: #268
santigimeno added a commit that referenced this pull request Feb 14, 2025
PR-URL: #266
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
PR-URL: #268
santigimeno added a commit that referenced this pull request Feb 14, 2025
PR-URL: #266
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
PR-URL: #269
santigimeno added a commit that referenced this pull request Feb 14, 2025
PR-URL: #266
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
PR-URL: #269
@tmm1
Copy link

tmm1 commented Apr 21, 2025

hi folks, are there any plans to upstream this work?

i started some research into this last week in nodejs/node#57955, but it looks like you guys are way ahead already

@santigimeno
Copy link
Member Author

hi folks, are there any plans to upstream this work?

Hi! Was planning to when I had the bandwidth, but not at this moment so feel free to pick ecfdc05 if it works for you. There are a couple of things missing in that commit to be ready for upstream though:

  • Test coverage.
  • Documentation.

Also, we haven't added tracing channels for tracking sessions yet, just streams (this could be done separately)
Let me know if you have further questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants