Skip to content

fix(socks5): evict unused origin pools - #5595

Merged
mcollina merged 1 commit into
nodejs:mainfrom
Kkartik14:fix/socks5-evict-unused-pools
Jul 30, 2026
Merged

fix(socks5): evict unused origin pools#5595
mcollina merged 1 commit into
nodejs:mainfrom
Kkartik14:fix/socks5-evict-unused-pools

Conversation

@Kkartik14

Copy link
Copy Markdown
Contributor

Fixes #5594

Rationale

Socks5ProxyAgent kept an empty per-origin pool in its internal cache after a SOCKS connection error or a normal target disconnect. A long-lived agent handling many destinations could therefore retain pools indefinitely.

Changes

  • remove an idle, non-busy origin pool on connectionError and disconnect
  • cover both lifecycle paths with SOCKS5 integration tests

Features

N/A

Bug Fixes

  • release unused SOCKS5 origin pools

Breaking Changes and Deprecations

N/A

Status

  • I have read and agreed to the Developer's Certificate of Origin
  • Tested (test/socks5-proxy-agent.js)
  • Benchmarked (optional)
  • Documented (not applicable)
  • Review ready
  • In review
  • Merge ready

Signed-off-by: Kartik Gupta <kartikgupta1474@gmail.com>

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

lgtm

@codecov-commenter

codecov-commenter commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.48%. Comparing base (21a8e1e) to head (cff0ad2).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5595   +/-   ##
=======================================
  Coverage   93.47%   93.48%           
=======================================
  Files         110      110           
  Lines       38238    38252   +14     
=======================================
+ Hits        35744    35759   +15     
+ Misses       2494     2493    -1     

☔ View full report in Codecov by Harness.
📢 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.

@mcollina
mcollina merged commit 165b582 into nodejs:main Jul 30, 2026
38 checks passed
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.

fix(socks5): evict unused origin pools

4 participants