Skip to content

Conversation

ronag
Copy link
Member

@ronag ronag commented Sep 6, 2025

If keepAliveTimeoutBuffer is set to undefined (for whatever reason) or if not set at all we will throw.

This adds a guard.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/http
  • @nodejs/net

@ronag ronag added the http Issues or PRs related to the http subsystem. label Sep 6, 2025
@ronag ronag requested a review from mcollina September 6, 2025 12:56
@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Sep 6, 2025
Copy link

codecov bot commented Sep 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.96%. Comparing base (737b42e) to head (0abd988).
⚠️ Report is 67 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #59784      +/-   ##
==========================================
+ Coverage   89.95%   89.96%   +0.01%     
==========================================
  Files         667      667              
  Lines      196776   197212     +436     
  Branches    38409    38530     +121     
==========================================
+ Hits       177006   177427     +421     
- Misses      12198    12204       +6     
- Partials     7572     7581       +9     
Files with missing lines Coverage Δ
lib/_http_server.js 96.96% <100.00%> (-0.23%) ⬇️

... and 46 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@haramj haramj mentioned this pull request Sep 6, 2025
@ronag ronag added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 7, 2025
@github-actions github-actions bot added request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Sep 7, 2025
Copy link
Contributor

github-actions bot commented Sep 7, 2025

Failed to start CI
   ⚠  No approving reviews found
   ✘  Refusing to run CI on potentially unsafe PR
https://github.com/nodejs/node/actions/runs/17531940843

Copy link
Member

@Flarna Flarna left a comment

Choose a reason for hiding this comment

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

I guess converting keepAliveTimeout and keepAliveTimeoutBuffer into a throwing setter is seen too breaking.
Personally I would prefer to fail on set instead of silently ignoring garbage set by user.

const keepAliveTimeout = NumberIsFinite(server.keepAliveTimeout) && server.keepAliveTimeout >= 0 ?
server.keepAliveTimeout : 0;
const keepAliveTimeoutBuffer = NumberIsFinite(server.keepAliveTimeoutBuffer) && server.keepAliveTimeoutBuffer >= 0 ?
server.keepAliveTimeoutBuffer : 1e3;
Copy link
Member

Choose a reason for hiding this comment

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

Maybe move the 1e3 into a shared const and use it at all places.

Copy link
Member Author

Choose a reason for hiding this comment

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

Because I don't want to break. It was 1e3 pre keepAliveTimeoutBuffer.

Copy link
Member

Choose a reason for hiding this comment

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

I don't understand your comment. Why is using a shard constant instead of duplicating the literal breaking?

@ronag ronag added request-ci Add this label to start a Jenkins CI on a PR. and removed request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. labels Sep 8, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 8, 2025
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot
Copy link
Collaborator

@ronag ronag added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. and removed needs-ci PRs that need a full CI run. labels Sep 9, 2025
@ronag ronag added the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 9, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 9, 2025
@nodejs-github-bot nodejs-github-bot merged commit 7d0f6be into nodejs:main Sep 9, 2025
68 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 7d0f6be

targos pushed a commit that referenced this pull request Sep 10, 2025
Adds a guard.

PR-URL: #59784
Reviewed-By: Gerhard Stöbich <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
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. http Issues or PRs related to the http subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants