Skip to content

fix: use pre-increment for request counter#5033

Open
BrainTR wants to merge 1 commit intonodejs:mainfrom
BrainTR:fix/request-counter
Open

fix: use pre-increment for request counter#5033
BrainTR wants to merge 1 commit intonodejs:mainfrom
BrainTR:fix/request-counter

Conversation

@BrainTR
Copy link
Copy Markdown

@BrainTR BrainTR commented Apr 15, 2026

This relates to...

Rationale

When the maxRequestsPerClient option is set, using post-increment on the request counter causes one extra request before the connection is closed.

Changes

Features

Bug Fixes

Breaking Changes and Deprecations

Status

Copy link
Copy Markdown
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.

Thanks, can you add a test for this?

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.03%. Comparing base (bc0a19c) to head (f68bd53).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5033   +/-   ##
=======================================
  Coverage   93.03%   93.03%           
=======================================
  Files         110      110           
  Lines       35793    35793           
=======================================
  Hits        33301    33301           
  Misses       2492     2492           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@BrainTR
Copy link
Copy Markdown
Author

BrainTR commented Apr 20, 2026

One of test added in #5034 covers the maxRequestsPerClient parameter. Since it also includes my changes, this PR can be closed once that one is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants