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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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.41%. Comparing base (7bc3e16) to head (a4a029a).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #55460      +/-   ##
==========================================
- Coverage   88.41%   88.41%   -0.01%     
==========================================
  Files         653      653              
  Lines      187435   187444       +9     
  Branches    36077    36075       -2     
==========================================
+ Hits       165714   165720       +6     
+ Misses      14960    14951       -9     
- Partials     6761     6773      +12     
Files with missing lines Coverage Δ
lib/internal/http2/core.js 95.53% <100.00%> (+0.01%) ⬆️

... and 23 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.

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 21, 2024

Renamed asyncRes to reqAsync for consistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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
5 participants