http: simplify parser lifetime tracking#18135
Closed
addaleax wants to merge 2 commits intonodejs:masterfrom
Closed
http: simplify parser lifetime tracking#18135addaleax wants to merge 2 commits intonodejs:masterfrom
addaleax wants to merge 2 commits intonodejs:masterfrom
Conversation
Instead of providing a separate class for keeping the parser alive during its own call back, just delay a possible `.close()` call until the stack has cleared completely.
jasnell
reviewed
Jan 13, 2018
lib/_http_common.js
Outdated
| parser.close(); | ||
| // Make sure the parser's stack has unwound before deleting the | ||
| // corresponding C++ object through .close(). | ||
| setImmediate((parser) => parser.close(), parser); |
Member
There was a problem hiding this comment.
It's trivial, but can you make this a top level function instead of allocating the closure?
Member
Author
There was a problem hiding this comment.
Does it make much of a difference if it’s not a closure? I would expect engines to optimize that away?
Member
Author
There was a problem hiding this comment.
Like, yes, I can do that, I’m just curious whether it makes any difference.
Member
There was a problem hiding this comment.
Yeah, it makes a difference. In this case it would likely be trivial but it definitely has an impact. The engines do not optimize away the closures at this point
jasnell
approved these changes
Jan 13, 2018
apapirovski
approved these changes
Jan 14, 2018
Member
Author
cjihrig
approved these changes
Jan 18, 2018
Member
Author
|
Landed in a7a1ada |
addaleax
added a commit
that referenced
this pull request
Jan 18, 2018
Instead of providing a separate class for keeping the parser alive during its own call back, just delay a possible `.close()` call until the stack has cleared completely. PR-URL: #18135 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
evanlucas
pushed a commit
that referenced
this pull request
Jan 30, 2018
Instead of providing a separate class for keeping the parser alive during its own call back, just delay a possible `.close()` call until the stack has cleared completely. PR-URL: #18135 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
evanlucas
pushed a commit
that referenced
this pull request
Jan 30, 2018
Instead of providing a separate class for keeping the parser alive during its own call back, just delay a possible `.close()` call until the stack has cleared completely. PR-URL: #18135 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Contributor
|
should we land this on LTS? does it need some time to bake? |
MayaLekova
pushed a commit
to MayaLekova/node
that referenced
this pull request
May 8, 2018
Instead of providing a separate class for keeping the parser alive during its own call back, just delay a possible `.close()` call until the stack has cleared completely. PR-URL: nodejs#18135 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins
pushed a commit
that referenced
this pull request
May 23, 2018
Instead of providing a separate class for keeping the parser alive during its own call back, just delay a possible `.close()` call until the stack has cleared completely. PR-URL: #18135 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins
pushed a commit
that referenced
this pull request
Jun 14, 2018
Instead of providing a separate class for keeping the parser alive during its own call back, just delay a possible `.close()` call until the stack has cleared completely. PR-URL: #18135 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Merged
rvagg
pushed a commit
that referenced
this pull request
Aug 16, 2018
Instead of providing a separate class for keeping the parser alive during its own call back, just delay a possible `.close()` call until the stack has cleared completely. PR-URL: #18135 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of providing a separate class for keeping the parser alive during its own call back, just delay a possible
.close()call until the stack has cleared completely.Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
http