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: reinject data received before http2 is attached #35678

Closed
wants to merge 2 commits into from

Conversation

mmomtchev
Copy link
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
Collaborator

Review requested:

  • @nodejs/http2
  • @nodejs/net

@nodejs-github-bot nodejs-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
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.

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

@mmomtchev
Copy link
Contributor Author

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?

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@addaleax
Copy link
Member

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

@mmomtchev
Copy link
Contributor Author

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

@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 16, 2020
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 16, 2020
@nodejs-github-bot
Copy link
Collaborator

@mcollina mcollina added the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 17, 2020
@github-actions github-actions bot 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
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

Copy link
Member

@mildsunrise mildsunrise left a comment

Choose a reason for hiding this comment

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

Thanks for the patch :)

lib/internal/http2/core.js Outdated Show resolved Hide resolved
@mildsunrise
Copy link
Member

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 :)

@mildsunrise mildsunrise 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>
@rickyes rickyes 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-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 20, 2020
@nodejs-github-bot
Copy link
Collaborator

Copy link
Contributor

@rickyes rickyes left a comment

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
Copy link
Collaborator

nodejs-github-bot commented Oct 21, 2020

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

Landed in 629e1ab...1f703e1

@github-actions github-actions bot closed this Oct 25, 2020
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
Member

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

@mildsunrise
Copy link
Member

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

mutza97 commented Oct 25, 2020

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>
@targos targos 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>
@BethGriggs BethGriggs 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>
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. lib / src Issues and PRs related to general changes in the lib or src directory. stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants