GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [v8.x backport] async_hooks: add missing async_hooks destroys in AsyncReset by basti1302 · Pull Request #23410 · nodejs/node

Conversation

@basti1302

@basti1302 basti1302 commented Oct 10, 2018

Copy link
Copy Markdown
Contributor

This adds missing async_hooks destroy calls for sockets (in
_http_agent.js) and HTTP parsers. We need to emit a destroy in
AsyncWrap#AsyncReset before assigning a new async_id when the instance
has already been in use and is being recycled, because in that case, we
have already emitted an init for the "old" async_id.

This also removes a duplicated init call for HTTP parser: Each time a
new parser was created, AsyncReset was being called via the C++ Parser
class constructor (super constructor AsyncWrap) and also via
Parser::Reinitialize.

PR-URL: #23272
Fixes: #19859
Reviewed-By: Matteo Collina [email protected]
Reviewed-By: Anna Henningsen [email protected]
Reviewed-By: James M Snell [email protected]

Checklist
  • make -j4 test (UNIX) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs involving general changes in the lib/ or src/ directories. v8.x labels Oct 10, 2018
basti1302
basti1302 commented Oct 10, 2018
View reviewed changes
Comment thread src/node_http_parser.cc Outdated

@basti1302 basti1302 Oct 10, 2018

Copy link
Copy Markdown
Contributor Author

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.

This check is actually new for the v8.x branch but since I was adding a new param here anyway (args[1]/isReused) I figured it wouldn't hurt to copy the existing check from master here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@basti1302 basti1302 mentioned this pull request Oct 11, 2018
Fix two missing async hooks destroy calls #23272
Closed
3 tasks done
addaleax
addaleax approved these changes Oct 11, 2018
View reviewed changes
@addaleax

addaleax commented Oct 11, 2018

Copy link
Copy Markdown
Member

CI: https://ci.nodejs.org/job/node-test-pull-request/17737/

As a heads up, this won’t be released in v8.x until #23272 has been in a Current release for 2 weeks, unless this is deemed a critical bugfix (which I assume it won’t be).

basti1302 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@basti1302

basti1302 commented Oct 11, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

As a heads up, this won’t be released in v8.x until #23272 has been in a Current release for 2 weeks, [...]

Just for my understanding - "Current release" in this case means a 10.x release, right? So the timeline would be

  • [v10.x backport] async_hooks: add missing async_hooks destroys in AsyncReset #23404 (backport to 10.x-staging) gets merged
  • a regular 10.x release happens, which includes this fix
  • at least two weeks pass
  • this can get merged
  • a regular 8.x maintenance release happens

Is that how this works?

As to the criticality: I don't know the criteria for critical bugfixes. The issues causes memory leaks and thus causes processes to die with out-out-of-memory. At least customers of some APM vendors (like my company) are affected.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@BethGriggs BethGriggs added the baking-for-lts PRs whose changes need more time before an LTS backport. label Oct 16, 2018
@basti1302
async_hooks: add missing async_hooks destroys in AsyncReset
5f22659
This adds missing async_hooks destroy calls for sockets (in
_http_agent.js) and HTTP parsers. We need to emit a destroy in
AsyncWrap#AsyncReset before assigning a new async_id when the instance
has already been in use and is being recycled, because in that case, we
have already emitted an init for the "old" async_id.

This also removes a duplicated init call for HTTP parser: Each time a
new parser was created, AsyncReset was being called via the C++ Parser
class constructor (super constructor AsyncWrap) and also via
Parser::Reinitialize.

PR-URL: nodejs#23272
Fixes: nodejs#19859
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@basti1302
basti1302 force-pushed the backport-8-23272 branch from d9af7ec to 5f22659 Compare November 2, 2018 09:04
@basti1302

basti1302 commented Nov 2, 2018

Copy link
Copy Markdown
Contributor Author

Rebased this on v8.x-staging to resolve conflict in src/async_wrap.cc.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

MylesBorins pushed a commit that referenced this pull request Nov 4, 2018
@basti1302 @MylesBorins
async_hooks: add missing async_hooks destroys in AsyncReset
26d145a
This adds missing async_hooks destroy calls for sockets (in
_http_agent.js) and HTTP parsers. We need to emit a destroy in
AsyncWrap#AsyncReset before assigning a new async_id when the instance
has already been in use and is being recycled, because in that case, we
have already emitted an init for the "old" async_id.

This also removes a duplicated init call for HTTP parser: Each time a
new parser was created, AsyncReset was being called via the C++ Parser
class constructor (super constructor AsyncWrap) and also via
Parser::Reinitialize.

Backport-PR-URL: #23410
PR-URL: #23272
Fixes: #19859
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@MylesBorins

MylesBorins commented Nov 4, 2018

Copy link
Copy Markdown
Contributor

landed in 26d145a

basti1302 reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@MylesBorins MylesBorins closed this Nov 4, 2018
@MylesBorins MylesBorins removed the baking-for-lts PRs whose changes need more time before an LTS backport. label Nov 4, 2018
@basti1302
basti1302 deleted the backport-8-23272 branch November 4, 2018 13:54
@basti1302

basti1302 commented Nov 4, 2018

Copy link
Copy Markdown
Contributor Author

@BethGriggs Any chance this could be included in v8.13.0, that seems to be scheduled for later this month? I'm not familiar with the LTS release process, but #23974 looks like the scope of 8.13.0 is already being defined and this is probably not included.

BethGriggs reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@WingMrL WingMrL mentioned this pull request Nov 6, 2019
Memory leak in Node 8.9.3 Jeff-Lewis/cls-hooked#49
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@addaleax addaleax addaleax approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

lib / src Issues and PRs involving general changes in the lib/ or src/ directories.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@basti1302 @addaleax @MylesBorins @BethGriggs @nodejs-github-bot
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.