Skip to content
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: fix session memory tracking and small clean up #30351

Closed

Conversation

lundibundi
Copy link
Member

@lundibundi lundibundi commented Nov 10, 2019

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

http2: fix session memory tracking with pending input data
Previously DecrementCurrentSessionMemory call was made after the relevant variable was reset to 0.

http2: small clean up in OnStreamRead
Extract pending input memory size in a variable and change code appropriately.

Not sure how to reliably hit the changed case, could someone help so I can write a test for DecrementCurrentSessionMemory?

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. http2 Issues or PRs related to the http2 subsystem. labels Nov 10, 2019
@lundibundi lundibundi changed the title http2: fix read memory track and small clean up http2: fix session memory tracking and small clean up Nov 10, 2019
Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess if you want to write a test for this, you could build something based on test-http2-generic-streams.js that triggers this condition and takes a heap dump?

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Nov 17, 2019

@lundibundi lundibundi added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Nov 17, 2019
@lundibundi lundibundi added blocked PRs that are blocked by other issues or PRs. and removed author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Nov 27, 2019
@lundibundi
Copy link
Member Author

Waiting for this #30684 to land. I'll then rebase and update this.

@addaleax addaleax removed the blocked PRs that are blocked by other issues or PRs. label Nov 30, 2019
* avoid consecutive decrement/increment session memory calls.
* only Resize the buffer when it is needed.
* flip `stream_buf_offset_` condition to the LIKELY case.
@nodejs-github-bot
Copy link
Collaborator

@lundibundi
Copy link
Member Author

@jasnell @addaleax @devnexen this got changed slightly, pinging to let you know.

@nodejs-github-bot
Copy link
Collaborator

@lundibundi
Copy link
Member Author

@jasnell @addaleax @devnexen could someone re-approve please? I consider this author ready, but don't want to have this landed until there is at least one approval of the new changes.
/cc @nodejs/http2

@addaleax addaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 5, 2019
addaleax pushed a commit that referenced this pull request Dec 6, 2019
PR-URL: #30351
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax pushed a commit that referenced this pull request Dec 6, 2019
* avoid consecutive decrement/increment session memory calls.
* only Resize the buffer when it is needed.
* flip `stream_buf_offset_` condition to the LIKELY case.

PR-URL: #30351
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@addaleax
Copy link
Member

addaleax commented Dec 6, 2019

Landed in bfd9de6...51ccf1b

@addaleax addaleax closed this Dec 6, 2019
targos pushed a commit that referenced this pull request Dec 9, 2019
PR-URL: #30351
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request Dec 9, 2019
* avoid consecutive decrement/increment session memory calls.
* only Resize the buffer when it is needed.
* flip `stream_buf_offset_` condition to the LIKELY case.

PR-URL: #30351
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Dec 13, 2019
targos pushed a commit that referenced this pull request Jan 13, 2020
PR-URL: #30351
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request Jan 13, 2020
* avoid consecutive decrement/increment session memory calls.
* only Resize the buffer when it is needed.
* flip `stream_buf_offset_` condition to the LIKELY case.

PR-URL: #30351
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BethGriggs pushed a commit that referenced this pull request Feb 6, 2020
PR-URL: #30351
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BethGriggs pushed a commit that referenced this pull request Feb 6, 2020
* avoid consecutive decrement/increment session memory calls.
* only Resize the buffer when it is needed.
* flip `stream_buf_offset_` condition to the LIKELY case.

PR-URL: #30351
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Feb 8, 2020
lundibundi added a commit to lundibundi/node that referenced this pull request Jul 22, 2020
mcollina pushed a commit that referenced this pull request Jul 27, 2020
Refs: #34315
Refs: #30351

PR-URL: #34480
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jul 27, 2020
Refs: #34315
Refs: #30351

PR-URL: #34480
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
codebytere pushed a commit that referenced this pull request Nov 3, 2020
Refs: #34315
Refs: #30351

PR-URL: #34480
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
MylesBorins pushed a commit that referenced this pull request Nov 16, 2020
Refs: #34315
Refs: #30351

PR-URL: #34480
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. http2 Issues or PRs related to the http2 subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants