Skip to content

http2: reinject data received before http2 is attached - #35678

Closed
mmomtchev wants to merge 2 commits into
nodejs:masterfrom
mmomtchev:http2-tls-reinject
Closed

http2: reinject data received before http2 is attached#35678
mmomtchev wants to merge 2 commits into
nodejs:masterfrom
mmomtchev:http2-tls-reinject

Conversation

@mmomtchev

Copy link
Copy Markdown
Contributor
  • [x ] make -j4 test (UNIX), or vcbuild test (Windows) passes
  • [x ] tests and/or benchmarks are included
  • [x ] commit message follows commit guidelines

Reinject the data already received from the TLS
socket when the HTTP2 client is attached with a
delay
Fixes: nodejs#35475
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/http2
  • @nodejs/net

@nodejs-github-botnodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. labels Oct 16, 2020

@addaleaxaddaleax left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you also do this for TLS, so that #34958 is fully covered? :)

@mmomtchev

Copy link
Copy Markdown
ContributorAuthor

Can you also do this for TLS, so that #34958 is fully covered? :)

Not very sure I understand, in fact I shamelessly copied that from the TLS code?
#34958 seems to be an alternative implementation of the same problem?

@mcollinamcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@addaleax

Copy link
Copy Markdown
Member

Ah, right :) Cool. I’ll close my PR. :)

@mmomtchev

Copy link
Copy Markdown
ContributorAuthor

That PR has one drawback: it doesn't allow for the user code to listen for remote_settings - when the data is already waiting in the socket, remote_settings will be sent before the user callback has been installed

@mcollinamcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 16, 2020
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 16, 2020
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@mcollinamcollina added the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 17, 2020
@github-actionsgithub-actionsBot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Oct 17, 2020
@github-actions

Copy link
Copy Markdown
Contributor
Commit Queue failed
- Loading data for nodejs/node/pull/35678
✔ Done loading data for nodejs/node/pull/35678
----------------------------------- PR info ------------------------------------
Title http2: reinject data received before http2 is attached (#35678)
⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch mmomtchev:http2-tls-reinject -> nodejs:master
Labels C++, lib / src
Commits 1
- http2: reinject data received before http2 is attached
Committers 1
- Momtchil Momtchev PR-URL: https://github.com/nodejs/node/pull/35678
Reviewed-By: Anna Henningsen Reviewed-By: Matteo Collina ------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/35678
Reviewed-By: Anna Henningsen Reviewed-By: Matteo Collina --------------------------------------------------------------------------------
✖ Last GitHub CI failed
ℹ Last Full PR CI on 2020-10-16T20:32:53Z: https://ci.nodejs.org/job/node-test-pull-request/33679/
- Querying data for job/node-test-pull-request/33679/
✔ Build data downloaded
- Querying failures of job/node-test-commit/41433/
✔ Data downloaded
✖ 3 failure(s) on the last Jenkins CI run
ℹ This PR was created on Fri, 16 Oct 2020 11:44:25 GMT
✔ Approvals: 2
✔ - Anna Henningsen (@addaleax): https://github.com/nodejs/node/pull/35678#pullrequestreview-510395321
✔ - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/35678#pullrequestreview-510398648
✖ This PR needs to wait 26 more hours to land
--------------------------------------------------------------------------------
✔ Aborted `git node land` session in /home/runner/work/node/node/.ncu

Commit Queue action: https://github.com/nodejs/node/actions/runs/312171239

@mildsunrisemildsunrise 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.

Thanks for the patch :)

Comment threadlib/internal/http2/core.js Outdated
@mildsunrise

Copy link
Copy Markdown
Contributor

I still think I prefer @addaleax approach (using JSStreamSocket in these cases) because it's simple and doesn't require us to add 'inject' logic to every native handle, doesn't have the drawback mentioned here, and can be reverted easily once/if we fix this properly in StreamBase. But no big deal, let's fix this for now and we'll see :)

@mildsunrisemildsunrise added http2 Issues or PRs related to the http2 subsystem. stream Issues and PRs related to the stream subsystem. labels Oct 18, 2020
We reinject when the sockets has already waiting
data, remarked by @mildsunrise
Co-authored-by: Alba Mendez <me@alba.sh>
@rickyesrickyes added request-ci Add this label to start a Jenkins CI on a PR. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Oct 20, 2020
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 20, 2020
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@rickyesrickyes 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, thx

@nodejs-github-bot

nodejs-github-bot commented Oct 21, 2020

Copy link
Copy Markdown
Collaborator

@rickyesrickyes added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Oct 22, 2020
@aduh95aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 25, 2020
@github-actionsgithub-actionsBot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 25, 2020
@github-actions

Copy link
Copy Markdown
Contributor

Landed in 629e1ab...1f703e1

nodejs-github-bot pushed a commit that referenced this pull request Oct 25, 2020
Reinject the data already received from the TLS
socket when the HTTP2 client is attached with a
delay
Fixes: #35475
PR-URL: #35678
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Alba Mendez <me@alba.sh>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
nodejs-github-bot pushed a commit that referenced this pull request Oct 25, 2020
We reinject when the sockets has already waiting
data, remarked by @mildsunrise
Co-authored-by: Alba Mendez <me@alba.sh>
PR-URL: #35678
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Alba Mendez <me@alba.sh>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
@mildsunrise

Copy link
Copy Markdown
Contributor

hmm, this landed as two separate commits instead of squashing them into one... what do we do in these cases?

@mildsunrise

Copy link
Copy Markdown
Contributor

it's still (almost) at the tip of the branch, I volunteer to do a force push to undo and land properly if given permission... if it's too risky we can leave it like that

@mutza97

Copy link
Copy Markdown

Reply

targos pushed a commit that referenced this pull request Nov 3, 2020
Reinject the data already received from the TLS
socket when the HTTP2 client is attached with a
delay
Fixes: #35475
PR-URL: #35678
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Alba Mendez <me@alba.sh>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
targos pushed a commit that referenced this pull request Nov 3, 2020
We reinject when the sockets has already waiting
data, remarked by @mildsunrise
Co-authored-by: Alba Mendez <me@alba.sh>
PR-URL: #35678
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Alba Mendez <me@alba.sh>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
@targostargos mentioned this pull request Nov 3, 2020
BethGriggs pushed a commit that referenced this pull request Dec 8, 2020
Reinject the data already received from the TLS
socket when the HTTP2 client is attached with a
delay
Fixes: #35475
PR-URL: #35678
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Alba Mendez <me@alba.sh>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
BethGriggs pushed a commit that referenced this pull request Dec 8, 2020
We reinject when the sockets has already waiting
data, remarked by @mildsunrise
Co-authored-by: Alba Mendez <me@alba.sh>
PR-URL: #35678
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Alba Mendez <me@alba.sh>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
BethGriggs pushed a commit that referenced this pull request Dec 10, 2020
Reinject the data already received from the TLS
socket when the HTTP2 client is attached with a
delay
Fixes: #35475
PR-URL: #35678
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Alba Mendez <me@alba.sh>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
BethGriggs pushed a commit that referenced this pull request Dec 10, 2020
We reinject when the sockets has already waiting
data, remarked by @mildsunrise
Co-authored-by: Alba Mendez <me@alba.sh>
PR-URL: #35678
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Alba Mendez <me@alba.sh>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
@BethGriggsBethGriggs mentioned this pull request Dec 10, 2020
BethGriggs pushed a commit that referenced this pull request Dec 15, 2020
Reinject the data already received from the TLS
socket when the HTTP2 client is attached with a
delay
Fixes: #35475
PR-URL: #35678
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Alba Mendez <me@alba.sh>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
BethGriggs pushed a commit that referenced this pull request Dec 15, 2020
We reinject when the sockets has already waiting
data, remarked by @mildsunrise
Co-authored-by: Alba Mendez <me@alba.sh>
PR-URL: #35678
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Alba Mendez <me@alba.sh>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
@vinsonchuongvinsonchuong mentioned this pull request Apr 3, 2021
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.c++Issues and PRs that require attention from people who are familiar with C++.http2Issues or PRs related to the http2 subsystem.lib / srcIssues and PRs related to general changes in the lib or src directory.streamIssues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants

@mmomtchev@nodejs-github-bot@addaleax@mildsunrise@mutza97@mcollina@fhinkel@Trott@rickyes@aduh95