-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
http2: add diagnostics channel 'http2.server.stream.start' #58449
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
http2: add diagnostics channel 'http2.server.stream.start' #58449
Conversation
Signed-off-by: Darshan Sen <raisinten@gmail.com>
Review requested:
|
This comment was marked as outdated.
This comment was marked as outdated.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #58449 +/- ##
==========================================
+ Coverage 90.19% 90.22% +0.03%
==========================================
Files 635 635
Lines 187255 187588 +333
Branches 36775 36836 +61
==========================================
+ Hits 168896 169256 +360
+ Misses 11137 11096 -41
- Partials 7222 7236 +14
🚀 New features to boost your workflow:
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
@@ -1246,6 +1246,13 @@ closing the stream can be retrieved using the `stream.rstCode` property. | |||
|
|||
Emitted when a stream is created on the server. | |||
|
|||
`http2.server.stream.start` |
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.
It seems this one comes always together with http2.server.stream.created
. In one case there is a nextTick
in between.
Which use case is solved by this extra event?
If the timing between created and start is important we should test the timing stays 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.
The distinction between the two is that 'created' is for when the stream has just been created but 'start' is where the application starts using the stream. Here, 'start' gets called in the nextTick because that's where the pushStream callback gets invoked, where the user code can start using the push stream. I have added a test for the timings, PTAL @Flarna .
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.
But they always come in pairs, sometimes with a nextTick
inbetween, sometimes not.
But there is no case where a create is not immediately followed by a start right?
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.
Yes, that's right. It could be useful to debug any performance issues that might be stemming from the blocking code that runs after pushStream()
get called but before the callback is fired.
Signed-off-by: Darshan Sen <raisinten@gmail.com>
This comment was marked as outdated.
This comment was marked as outdated.
// Since ServerHttp2Stream is not exported from any module, this just checks | ||
// if the stream is an instance of Duplex and the constructor name is | ||
// 'ServerHttp2Stream'. | ||
assert.ok(stream instanceof Duplex); |
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.
note that exposing internals makes it hard to ever move this out of experimental at some point in time in future.
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.
ServerHttp2Stream
is actually a part of the public API. It's just that this class is not exposed for direct use by application code, like new ServerHttp2Stream()
, although users still can by accessing the .constructor
property of one of these instances.
This comment was marked as outdated.
This comment was marked as outdated.
Landed in fd46569 |
Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: #58449 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: #58449 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
No description provided.