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 client async storage persistence #55460

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

orgads
Copy link
Contributor

@orgads orgads commented Oct 19, 2024

Create and store an AsyncResource for each stream, following a similar approach as used in HttpAgent.

Fixes #55376

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/http2
  • @nodejs/net

@nodejs-github-bot nodejs-github-bot added http2 Issues or PRs related to the http2 subsystem. needs-ci PRs that need a full CI run. labels Oct 19, 2024
@orgads orgads changed the title http2: Fix client async storage persistence http2: fix client async storage persistence Oct 19, 2024
Copy link

codecov bot commented Oct 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.42%. Comparing base (53b1050) to head (ecc25ca).
Report is 34 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #55460   +/-   ##
=======================================
  Coverage   88.42%   88.42%           
=======================================
  Files         654      654           
  Lines      187552   187561    +9     
  Branches    36087    36090    +3     
=======================================
+ Hits       165839   165854   +15     
- Misses      14950    14956    +6     
+ Partials     6763     6751   -12     
Files with missing lines Coverage Δ
lib/internal/http2/core.js 95.53% <100.00%> (+0.01%) ⬆️

... and 33 files with indirect coverage changes

@orgads orgads marked this pull request as draft October 20, 2024 05:55
@orgads
Copy link
Contributor Author

orgads commented Oct 20, 2024

I'll try to improve it and use internals instead of AsyncResource.

@orgads orgads marked this pull request as ready for review October 20, 2024 19:30
@orgads
Copy link
Contributor Author

orgads commented Oct 20, 2024

I didn't find a better solution. Open for suggestions :)

@orgads
Copy link
Contributor Author

orgads commented Oct 21, 2024

@mcollina Any comments?

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

However I'm concerned that this will add overhead.

@orgads
Copy link
Contributor Author

orgads commented Oct 21, 2024

Are headers received only once per stream? If they are, we can unset the resource after using it in onSessionHeaders.

@orgads
Copy link
Contributor Author

orgads commented Oct 21, 2024

Renamed asyncRes to reqAsync for consistency.

@lpinca lpinca added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 22, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 22, 2024
@nodejs-github-bot

This comment was marked as outdated.

@orgads
Copy link
Contributor Author

orgads commented Oct 22, 2024

The failures are unrelated to my changes.
https://ci.nodejs.org/job/node-test-commit-arm/nodes=rhel8-arm64/55481/console
This one is unclear. I saw a similar timeout in another test on the previous run of the same configuration.

11:01:35 not ok 4121 parallel/test-stream-readable-unpipe-resume
11:01:35   ---
11:01:35   duration_ms: 360017.24500
11:01:35   severity: fail
11:01:35   exitcode: -15
11:01:35   stack: |-
11:01:35     timeout
11:01:35   ...

https://ci.nodejs.org/job/node-test-commit-osx-arm/17293/nodes=osx11/console
I didn't touch http, only http2.

11:00:21 not ok 4213 sequential/test-http-server-request-timeouts-mixed
11:00:21   ---
11:00:21   duration_ms: 3218.23100
11:00:21   severity: fail
11:00:21   exitcode: 1
11:00:21   stack: |-
11:00:21     node:internal/assert/utils:281
11:00:21         throw err;
11:00:21         ^
11:00:21     
11:00:21     AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
11:00:21     
11:00:21       assert(request2.completed)
11:00:21     
11:00:21         at Timeout._onTimeout (/Users/iojs/build/workspace/node-test-commit-osx-arm/nodes/osx11/test/sequential/test-http-server-request-timeouts-mixed.js:108:5)
11:00:21         at listOnTimeout (node:internal/timers:614:17)
11:00:21         at process.processTimers (node:internal/timers:549:7) {
11:00:21       generatedMessage: true,
11:00:21       code: 'ERR_ASSERTION',
11:00:21       actual: false,
11:00:21       expected: true,
11:00:21       operator: '=='
11:00:21     }

Is it possible to retrigger these?

Create and store an AsyncResource for each stream, following a similar
approach as used in HttpAgent.

Fixes: nodejs#55376
@orgads
Copy link
Contributor Author

orgads commented Oct 24, 2024

Rebased.

@orgads
Copy link
Contributor Author

orgads commented Oct 25, 2024

@lpinca Can you please trigger CI again?

@lpinca lpinca added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 25, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 25, 2024
@nodejs-github-bot

This comment was marked as outdated.

@orgads
Copy link
Contributor Author

orgads commented Oct 27, 2024

@lpinca the failures look random and unrelated to my changes. How do we proceed from here?

@nodejs-github-bot
Copy link
Collaborator

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

@orgads
Copy link
Contributor Author

orgads commented Oct 27, 2024

Passed! Thank you.

@orgads
Copy link
Contributor Author

orgads commented Oct 29, 2024

How do we proceed from here?

@Qard Qard added the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 30, 2024
@nodejs-github-bot nodejs-github-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 30, 2024
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/55460
✔  Done loading data for nodejs/node/pull/55460
----------------------------------- PR info ------------------------------------
Title      http2: fix client async storage persistence (#55460)
Author     Orgad Shaneh <orgads@gmail.com> (@orgads)
Branch     orgads:http2-async -> nodejs:main
Labels     http2, needs-ci
Commits    1
 - http2: fix client async storage persistence
Committers 1
 - Orgad Shaneh <orgad.shaneh@audiocodes.com>
PR-URL: https://github.com/nodejs/node/pull/55460
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/55460
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
--------------------------------------------------------------------------------
   ⚠  Commits were pushed since the last approving review:
   ⚠  - http2: fix client async storage persistence
   ℹ  This PR was created on Sat, 19 Oct 2024 20:46:33 GMT
   ✔  Approvals: 3
   ✔  - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/55460#pullrequestreview-2380687991
   ✔  - Stephen Belanger (@Qard): https://github.com/nodejs/node/pull/55460#pullrequestreview-2384391523
   ✔  - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/55460#pullrequestreview-2382123844
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2024-10-27T05:45:51Z: https://ci.nodejs.org/job/node-test-pull-request/63307/
- Querying data for job/node-test-pull-request/63307/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/11594005797

@Flarna Flarna added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. labels Oct 31, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 31, 2024
@nodejs-github-bot nodejs-github-bot merged commit f67e45e into nodejs:main Oct 31, 2024
71 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in f67e45e

@orgads orgads deleted the http2-async branch November 1, 2024 13:16
@orgads
Copy link
Contributor Author

orgads commented Nov 1, 2024

Thank you all! What's the process for backporting it to 22.x?

RafaelGSS pushed a commit that referenced this pull request Nov 1, 2024
Create and store an AsyncResource for each stream, following a similar
approach as used in HttpAgent.

Fixes: #55376
PR-URL: #55460
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
louwers pushed a commit to louwers/node that referenced this pull request Nov 2, 2024
Create and store an AsyncResource for each stream, following a similar
approach as used in HttpAgent.

Fixes: nodejs#55376
PR-URL: nodejs#55460
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
@Flarna
Copy link
Member

Flarna commented Nov 4, 2024

@orgads Usually this goes automatically. First it will land on 23 and later on 22.

In case cherry-picking this commit from main to the release branch fails for some reason a label + comment will be added here indicating it requires a dedicated manual created backport PR.

@orgads
Copy link
Contributor Author

orgads commented Nov 4, 2024

Thank you.

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. commit-queue-failed An error occurred while landing this pull request using GitHub Actions. http2 Issues or PRs related to the http2 subsystem. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

http2: Async resource store is not applied on 'response' event
7 participants