Skip to content

Bugfix: Stale UDP connection pool eviction#75

Merged
masterking32 merged 2 commits into
masterking32:mainfrom
abolix:abolix-stale-udp
Mar 31, 2026
Merged

Bugfix: Stale UDP connection pool eviction#75
masterking32 merged 2 commits into
masterking32:mainfrom
abolix:abolix-stale-udp

Conversation

@abolix
Copy link
Copy Markdown
Contributor

@abolix abolix commented Mar 31, 2026

UDP connections to DNS resolvers are pooled for reuse. But after sitting idle for 60+ seconds, NAT middleboxes (very common on Iran ISPs) may expire the port mapping. The connection's local ephemeral port is now dead — writes succeed (UDP is fire-and-forget), but responses from the resolver get routed to a closed port and silently vanish. This looks like a resolver being "lossy"

@masterking32 can you please double check the code ? looks right on the paper but haven't tested this in production because of poor internet. thank you.

abolix added 2 commits March 31, 2026 16:20
Updated UDP connection pooling to include connection age management. Changed the pool to store pooledUDPConn structs instead of UDPConn pointers.
@masterking32 masterking32 merged commit 62947ad into masterking32:main Mar 31, 2026
1 check 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.

2 participants