Skip to content

http: reduce likelihood of race conditions on keep-alive timeout - #54863

Closed
jazelly wants to merge 1 commit into
nodejs:mainfrom
jazelly:fix-54293
Closed

jazelly wants to merge 1 commit into
nodejs:mainfrom
jazelly:fix-54293

Conversation

@jazelly

@jazelly jazelly commented Sep 9, 2024 •

Copy link
Copy Markdown
Member

This is the continued work from #52653 to fix many similar issues when request is near socket keepAliveTimeout threshold. Added 1 second internal timeout to account for network latency for both server and client side.

Fixes: #52649
Refs: #54293

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/http
  • @nodejs/net

@nodejs-github-bot nodejs-github-bot added http Issues and PRs related to the http subsystem. needs-ci PRs that need a full CI run. labels Sep 9, 2024

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

A minor nit but I think it looks fine.

Comment thread lib/_http_agent.js Resolved
Comment thread lib/_http_agent.js Resolved
@codecov

ghost commented Sep 9, 2024 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.89%. Comparing base (e1e312d) to head (5f6ab97).
Report is 45 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #54863      +/-   ##
==========================================
- Coverage   87.90%   87.89%   -0.01%     
==========================================
  Files         651      651              
  Lines      183343   183387      +44     
  Branches    35710    35720      +10     
==========================================
+ Hits       161165   161189      +24     
- Misses      15466    15469       +3     
- Partials     6712     6729      +17     
Files with missing lines Coverage Δ
lib/_http_agent.js 98.19% <100.00%> (+0.03%) ⬆️
lib/_http_server.js 96.65% <100.00%> (+0.01%) ⬆️

... and 50 files with indirect coverage changes

ghost 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.

The code LGTM.

@ShogunPanda The "changes requested" here was a misclick, I would assume?

Pinging @zanettea as author of original patch.

Also, i'm not sure where does the Co-authored-by email come from. git log --pretty=format:"Committer: %ce | Author: %ae" 2c3d3832f573fc59baec28d3e6249b055ebfd2b6 shows different addresses (perhaps the author email is the most correct to use here?).

@jazelly

ghost commented Sep 10, 2024 •

Copy link
Copy Markdown
Member Author

@LiviaMedeiros I grabbed @zanettea's email from one of his repo, but that one is probably incorrect, as github doesn't link back to his account. I'll try these emails and see which one is corrrect.

Update: yep, the author email is correct. TIL

Fixes: nodejs#52649
Refs: nodejs#54293

Co-authored-by: Arrigo Zanette <zanettea@gmail.com>
@nikwen

ghost commented Sep 11, 2024

Copy link
Copy Markdown
Contributor

Thanks for picking up the work, @jazelly! Appreciate it! 🙌

@jakecastelli jakecastelli added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Sep 12, 2024
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Sep 12, 2024
@nodejs-github-bot

ghost commented Sep 12, 2024 •

Copy link
Copy Markdown
Collaborator

@jasnell

ghost commented Sep 13, 2024

Copy link
Copy Markdown
Member

Landed in 05ad947

1 similar comment
@jasnell

This comment was marked as duplicate.

@jasnell jasnell closed this Sep 13, 2024
@RafaelGSS RafaelGSS mentioned this pull request Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

http Issues and PRs related to the http subsystem. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

http: keepalive race condition near timeout

10 participants