Skip to content

http2: compat avoid bind and properly cleanup stream - #20374

Closed
ronag wants to merge 1 commit into
nodejs:masterfrom
nxtedition:http2-compat-perf
Closed

http2: compat avoid bind and properly cleanup stream#20374
ronag wants to merge 1 commit into
nodejs:masterfrom
nxtedition:http2-compat-perf

Conversation

@ronag

@ronagronag commented Apr 27, 2018

Copy link
Copy Markdown
Member

Avoid unnecessary function bind.

Also fixes a bug where kProxySocket was assigned null on the wrong object as well as properly cleanup the stream object.

Checklis
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-botnodejs-github-bot added dont-land-on-v4.x http2 Issues or PRs related to the http2 subsystem. labels Apr 27, 2018
@ronag
ronagforce-pushed the http2-compat-perf branch 4 times, most recently from ebc8bb2 to 34ad49aCompareApril 27, 2018 23:02
@ronagronag changed the title http2: compat avoid bind and propertly cleanup kProxySockethttp2: compat avoid bind and properly cleanup streamApr 27, 2018
@ronag
ronagforce-pushed the http2-compat-perf branch 3 times, most recently from d57ba33 to 6c86160CompareApril 27, 2018 23:11
Comment threadlib/internal/http2/compat.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why these extra variables instead of just:

this.sendTrailers(this[kResponse][kTrailers]);

?

@ronagronagApr 27, 2018

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

No particular reason. Just style. I'm fine with changing if you want me to?

@ronag
ronagforce-pushed the http2-compat-perf branch from 6c86160 to 8a5874aCompareApril 27, 2018 23:37
Comment threadlib/internal/http2/compat.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

stream should be this

@ronag
ronagforce-pushed the http2-compat-perf branch from 8a5874a to 96b0de9CompareApril 27, 2018 23:40

@apapirovskiapapirovski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is on a good track but needs a bit of cleanup.

Comment threadlib/internal/http2/compat.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

onStreamCloseRequest? It's not really onRequestFinish.

Comment threadlib/internal/http2/compat.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please don't reassign this.

Comment threadlib/internal/http2/compat.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are all these detachments necessary? It will certainly make performance worse.

Comment threadlib/internal/http2/compat.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same as above: more accurate name and don't re-assign this please.

Comment threadlib/internal/http2/compat.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same as above. Unless this is 100% necessary, it would be better not to.

Comment threadlib/internal/http2/compat.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This change doesn't seem to relate to this PR.

Comment threadlib/internal/http2/compat.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This change doesn't seem to relate to this PR.

@ronag
ronagforce-pushed the http2-compat-perf branch 2 times, most recently from d7a0fbd to 525429aCompareApril 28, 2018 11:47
@ronag

Copy link
Copy Markdown
MemberAuthor

@apapirovski cleaned up

@ronag
ronagforce-pushed the http2-compat-perf branch 2 times, most recently from 20d1dce to 93c4f7dCompareApril 28, 2018 11:49
Comment threadlib/internal/http2/compat.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

res === undefined would be cleaner check here.

Comment threadlib/internal/http2/compat.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

req === undefined is more precise. Also please move const state = after the check.

@ronag
ronagforce-pushed the http2-compat-perf branch from 93c4f7d to 823bc93CompareApril 28, 2018 14:40
@ronag
ronagforce-pushed the http2-compat-perf branch from 823bc93 to ae50653CompareApril 28, 2018 14:41

@apapirovskiapapirovski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM thanks!

@apapirovski

Copy link
Copy Markdown
Contributor

@BridgeARBridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 29, 2018
@apapirovski

Copy link
Copy Markdown
Contributor

ping @nodejs/http2 would be nice to have at least one more review on this.

@mcollina

Copy link
Copy Markdown
Member

Also fixes a bug where kProxySocket was assigned null on the wrong object as well as properly cleanup the stream object.

Can you add a test for this?

@apapirovski

Copy link
Copy Markdown
Contributor

FWIW I don't think it's possible to test this without exporting the kProxySocket symbol. Although
since it's in internal, it's probably ok to do so.

@mcollina

Copy link
Copy Markdown
Member

👍 to exporting in the internal module.

@apapirovski

Copy link
Copy Markdown
Contributor

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

I will land this once done and create a test myself in a separate PR.

apapirovski pushed a commit that referenced this pull request May 16, 2018
PR-URL: #20374
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
@apapirovski

Copy link
Copy Markdown
Contributor

Landed in 0d762af

MylesBorins pushed a commit that referenced this pull request May 22, 2018
PR-URL: #20374
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
@addaleaxaddaleax mentioned this pull request May 22, 2018
kjin pushed a commit to kjin/node that referenced this pull request Aug 23, 2018
PR-URL: nodejs#20374
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
kjin pushed a commit to kjin/node that referenced this pull request Sep 11, 2018
PR-URL: nodejs#20374
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
kjin pushed a commit to kjin/node that referenced this pull request Sep 19, 2018
PR-URL: nodejs#20374
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
kjin pushed a commit to kjin/node that referenced this pull request Oct 16, 2018
PR-URL: nodejs#20374
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
BethGriggs pushed a commit that referenced this pull request Oct 17, 2018
Backport-PR-URL: #22850
PR-URL: #20374
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
@BethGriggsBethGriggs mentioned this pull request Oct 30, 2018
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.http2Issues or PRs related to the http2 subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@ronag@apapirovski@mcollina@mscdex@jasnell@trivikr@BridgeAR@nodejs-github-bot