Skip to content

bugfix : fix the udpConns map does not release new conns when its length is over 100 - #515

Open
FyZhu97 wants to merge 5 commits into
jpillora:masterfrom
FyZhu97:bugfix/udp-tun-conn-release
Open

bugfix : fix the udpConns map does not release new conns when its length is over 100#515
FyZhu97 wants to merge 5 commits into
jpillora:masterfrom
FyZhu97:bugfix/udp-tun-conn-release

Conversation

@FyZhu97

@FyZhu97 FyZhu97 commented Apr 30, 2024

Copy link
Copy Markdown
  1. fix the udpConns does not release new conn in udpConn map when the length is over maxConns. The length of map continues growing and eventually makes new connections cannot read.
  2. make maxConns configurable

方鸻 added 5 commits April 30, 2024 10:27
1. fix the udpConns does not release new conn in udpConn map when the length is over maxConns. The length of map continues growing and eventually makes new connections cannot read.
2. make maxConns configurable
…s over max size can not read but can also write to ensure consistent usage with previous implementation.
VHSgunzo added a commit to VHSgunzo/chisel that referenced this pull request Jun 23, 2024
terminar added a commit to terminar/chisel that referenced this pull request Sep 18, 2024
jpillora added a commit that referenced this pull request Jul 16, 2026
- flows beyond the conn cap are now marked write-only and swept
  once idle for UDP_DEADLINE, so the map drains below the cap and
  new flows regain read slots (was: stored forever, all subsequent
  flows permanently blackholed, memory unbounded)
- make the cap configurable via UDP_MAX_CONNS (default 100)
- close conns when read goroutines exit (fd leak: removed from the
  map but never closed, so closeAll could no longer reach them)
- make per-flow write errors non-fatal so an ICMP unreachable or a
  conn closed by its reader drops one flow, not the whole channel
- sweep runs in the single write goroutine, avoiding the timer
  races in PR #515 which could kill the channel mid-write
- unit test for sweep selection + e2e cap/recovery test

Closes md task 3

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant