[PR #5265] [CLOSED] 搞错了分支, 抱歉 #5215

Closed
opened 2026-05-05 14:56:51 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fatedier/frp/pull/5265
Author: @lovitus
Created: 3/28/2026
Status: Closed

Base: devHead: tmp-udpfix-pr


📝 Commits (1)

  • 61d12b2 mix: evict stale udp demux routes

📊 Changes

2 files changed (+278 additions, -0 deletions)

View changed files

pkg/transport/mix/udp_demux.go (+227 -0)
pkg/transport/mix/udp_demux_test.go (+51 -0)

📄 Description

变更说明

本 PR 引入 UDP demux 路由表老化清理机制,避免 UDP 源地址映射长期累积导致内存增长与陈旧路由残留。

主要修改

  • 新增 peerRoute,记录 lastSeen
  • peersmap[string]*demuxPacketConn 调整为带时间戳的路由记录
  • 增加定期清理:udpPeerRouteTTL=5mudpPeerRoutePruneInterval=1m
  • Serve() 主循环中按周期 prune 过期 peer route

测试

  • 新增 TestUDPDemuxPruneStalePeers,验证过期条目剔除与活跃条目保留
  • 保留并通过 TestDemuxPacketConnEnqueueAfterCloseIsDropped

备注

该改动不改变现有路由判定逻辑,仅补齐生命周期清理。


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/fatedier/frp/pull/5265 **Author:** [@lovitus](https://github.com/lovitus) **Created:** 3/28/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `tmp-udpfix-pr` --- ### 📝 Commits (1) - [`61d12b2`](https://github.com/fatedier/frp/commit/61d12b2835a38e89e6169039a57b197e10a9ecf0) mix: evict stale udp demux routes ### 📊 Changes **2 files changed** (+278 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `pkg/transport/mix/udp_demux.go` (+227 -0) ➕ `pkg/transport/mix/udp_demux_test.go` (+51 -0) </details> ### 📄 Description ## 变更说明 本 PR 引入 UDP demux 路由表老化清理机制,避免 UDP 源地址映射长期累积导致内存增长与陈旧路由残留。 ## 主要修改 - 新增 `peerRoute`,记录 `lastSeen` - `peers` 从 `map[string]*demuxPacketConn` 调整为带时间戳的路由记录 - 增加定期清理:`udpPeerRouteTTL=5m`,`udpPeerRoutePruneInterval=1m` - 在 `Serve()` 主循环中按周期 prune 过期 peer route ## 测试 - 新增 `TestUDPDemuxPruneStalePeers`,验证过期条目剔除与活跃条目保留 - 保留并通过 `TestDemuxPacketConnEnqueueAfterCloseIsDropped` ## 备注 该改动不改变现有路由判定逻辑,仅补齐生命周期清理。 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 14:56:51 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#5215
No description provided.