Skip to content

https: fix readable listener leak during proxy CONNECT#62913

Open
thisalihassan wants to merge 1 commit intonodejs:mainfrom
thisalihassan:fix-https-tunnel-readable-listener-leak
Open

https: fix readable listener leak during proxy CONNECT#62913
thisalihassan wants to merge 1 commit intonodejs:mainfrom
thisalihassan:fix-https-tunnel-readable-listener-leak

Conversation

@thisalihassan
Copy link
Copy Markdown
Contributor

establishTunnel() reused the same function as both the initial reader and the 'readable' listener, and re-subscribed it at the end of every call. Because EventEmitter iterates a snapshot of its listeners per emit, each 'readable' event fired every already-attached copy, and each copy re-subscribed

Fixes: #62904

establishTunnel() reused the same function as both the initial reader
and the 'readable' listener, and re-subscribed it at the end of every
call.

Fixes: nodejs#62904
Signed-off-by: Ali Hassan <ali-hassan27@outlook.com>
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto
  • @nodejs/http
  • @nodejs/net

@nodejs-github-bot nodejs-github-bot added https Issues or PRs related to the https subsystem. needs-ci PRs that need a full CI run. labels Apr 23, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.61%. Comparing base (1178926) to head (44d675e).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #62913      +/-   ##
==========================================
- Coverage   89.62%   89.61%   -0.02%     
==========================================
  Files         706      706              
  Lines      219203   219204       +1     
  Branches    41996    41995       -1     
==========================================
- Hits       196454   196431      -23     
- Misses      14658    14667       +9     
- Partials     8091     8106      +15     
Files with missing lines Coverage Δ
lib/https.js 98.22% <100.00%> (ø)

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

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

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

https proxy reattaches listeners without removing them

2 participants