Skip to content

fix: bound per-connection port-forward work (#298) - #823

Merged
MisterTea merged 3 commits into
masterfrom
issue-298
Sep 28, 2026
Merged

MisterTea merged 3 commits into
masterfrom
issue-298

Conversation

@MisterTea

@MisterTea MisterTea commented Sep 20, 2026 •

Copy link
Copy Markdown
Owner

Limits each forwarding handler to 64 KiB per event-loop pass, uses 16 KiB chunks, and adds regressions for the byte budget on both the source and destination forwarders. This prevents one busy tunnel from starving other tunnels or terminal traffic.

Merged current master so the budget sits on the SOCKS and stdio source path. The Catch2 tag is issue298 because a # tag makes test discovery fail.

Test plan

  • ForwardDestinationHandler yields after a bounded data batch: five queued 16 KiB reads, handler stops after four (64 KiB).
  • ForwardSourceHandler update yields after a bounded data batch: same budget on the source handler.
  • CI on this pull request is green.

Closes #298.

@codecov

codecov Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.89%. Comparing base (044bcb5) to head (a67ef1b).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #823   +/-   ##
=======================================
  Coverage   79.88%   79.89%           
=======================================
  Files         152      152           
  Lines       22144    22179   +35     
  Branches    14338    14365   +27     
=======================================
+ Hits        17690    17720   +30     
- Misses       2641     2647    +6     
+ Partials     1813     1812    -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.

@MisterTea MisterTea changed the title Issue: issue-298 test: sketch a tunnel backpressure regression for #298 Sep 20, 2026
@MisterTea MisterTea changed the title test: sketch a tunnel backpressure regression for #298 fix: bound per-connection port-forward work (#298) Sep 20, 2026
@MisterTea
MisterTea marked this pull request as draft September 20, 2026 16:37
…dget.

Preserve master's SOCKS/stdio forwarding path while retaining the 64 KiB
per-update read limit and 16 KiB chunks that prevent busy TCP tunnels
from starving the terminal event loop (#298).

Co-authored-by: Cursor <cursoragent@cursor.com>
@MisterTea
MisterTea marked this pull request as ready for review September 27, 2026 20:41
@MisterTea
MisterTea merged commit f50f878 into master Sep 28, 2026
37 checks passed
@MisterTea
MisterTea deleted the issue-298 branch September 28, 2026 02:03
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.

TCP tunnels can freeze terminal

2 participants