-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
http: fix http client leaky with double response #60062
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
base: main
Are you sure you want to change the base?
Conversation
Review requested:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #60062 +/- ##
==========================================
+ Coverage 88.53% 88.55% +0.01%
==========================================
Files 704 704
Lines 208087 208097 +10
Branches 40010 40005 -5
==========================================
+ Hits 184239 184287 +48
+ Misses 15866 15817 -49
- Partials 7982 7993 +11
🚀 New features to boost your workflow:
|
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.
One minor point, otherwise LGTM.
or emit a response event then emit an error event on request object ?
Emitting an error here would be a breaking change that will probably break things for some people in real cases. Without that, I don't think this is semver-major, since other than the leak the 2nd response doesn't seem to have been observable until now.
I think emitting an error would probably still be best, because it is an error case where something's clearly gone wrong, and this matches our docs, which say
If any error is encountered during the request (be that with DNS resolution, TCP level errors, or actual HTTP parse errors) an 'error' event is emitted on the returned request object
but that said, it might be better to separate the two issues.
How about we aim to ship this to resolve the leak, and then ship a separate semver-major PR making this into an emitted request error in future?
552bafc
to
6d9bd7d
Compare
Fixed: #60025
When a request corresponds to multiple responses, ensure that only the first one is processed and skip all subsequent invalid responses (or emit a
response
event then emit anerror
event on request object ?).make -j4 test
(UNIX), orvcbuild test
(Windows) passes