src: do not reuse HTTPParser#25094
Conversation
368187e to
5d9eebd
Compare
|
cc @nodejs/async_hooks @nodejs/diagnostics |
|
The problem with linter is that |
Just write: or alternatively use |
|
If I understand this correct the resource type is still Wouldn't it better to have two resource types instead? |
|
Perhaps the commit message could be more clear. 'do not reuse HTTPParser' makes it sound as if parser objects are not being reused, when in fact it's the associated async resource that's no longer being reused (if I understand correctly). |
AndreasMadsen
left a comment
There was a problem hiding this comment.
Thanks for spending time on this.
|
@Flarna maybe we could use |
|
Not sure here; maybe prefix with |
There was a problem hiding this comment.
Isn't this reusing the IncomingMessage constructor function instead of the concrete instance? If I understand the code correct the IncomingMessage instance is created in parserOnHeadersComplete.
If I'm correct I wonder why the dedicated test-httparser-reuse.js is not detecting this.
There was a problem hiding this comment.
@Drieger This one is still open and if I'm correct this is a no go.
There was a problem hiding this comment.
You are right @Flarna I'll investigate this more in depth.
There was a problem hiding this comment.
@Flarna kIncomingMessage is really a function as you said. I fixed the test to catch this.
I will also create a new object to be the resource for the server. Some other changes will be necessary as well. I will update the PR as soon as I this is working.
Change resource being used, previously HTTParser was being reused. We are now using IncomingMessage and ClientRequest objects. The goal here is to make the async resource unique for each async operation
Refs: #24330
Refs: nodejs/diagnostics#248
Refs: #21313
Co-authored-by: Matheus Marchini matheus@sthima.com
I continued @mmarchini work on #24330 and finished what was missing. I also added a test based on @AndreasMadsen comment nodejs/diagnostics#248 (comment)
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes