[GH-ISSUE #652] udp完成连接后不会自动退出,导致一大堆UDP ESTABLISHED残留在客户端 #509

Closed
opened 2026-05-05 12:19:57 -06:00 by gitea-mirror · 3 comments
Owner

Originally created by @thankeyes on GitHub (Mar 5, 2018).
Original GitHub issue: https://github.com/fatedier/frp/issues/652

Issue is only used for submiting bug report and documents typo. If there are same issues or answers can be found in documents, we will close it directly.
(为了节约时间,提高处理问题的效率,不按照格式填写的 issue 将会直接关闭。)

Use the commands below to provide key information from your environment:
You do NOT have to include this information if this is a FEATURE REQUEST

What version of frp are you using (./frpc -v or ./frps -v)?
客户端服务端都是frp_0.16.0

What operating system and processor architecture are you using (go env)?
服务端是ubuntu14.04X64 客户端是K2P,openwrt

Configures you used:
###frpc
########################
[common]
server_addr = XXXXXXX
server_port = 1505
##heartbeat_interval = 2
##heartbeat_timeout = 5
[udp1]
type = udp
local_ip = 127.0.0.1
local_port = 53
remote_port = 1553

###frps
##########################
[common]
bind_port = 1505

Steps to reproduce the issue:
1.服务器udp1553监听了本地udp53端口
2.不断dig服务器1553端口(映射是完美运行的,可以dig通)
3.一大堆UDP ESTABLISHED残留在客户端不会消除(加了timeout参数也是不会消除)

Describe the results you received:

[root@pan:/root]#sh net|grep frp
udp 0 0 127.0.0.1:52446 127.0.0.1:53 ESTABLISHED 1601/frpc7
udp 0 0 127.0.0.1:45294 127.0.0.1:53 ESTABLISHED 1601/frpc7
udp 0 0 127.0.0.1:49654 127.0.0.1:53 ESTABLISHED 1601/frpc7
udp 0 0 127.0.0.1:54017 127.0.0.1:53 ESTABLISHED 1601/frpc7
udp 0 0 127.0.0.1:54037 127.0.0.1:53 ESTABLISHED 1601/frpc7
udp 0 0 127.0.0.1:55844 127.0.0.1:53 ESTABLISHED 1601/frpc7
udp 0 0 127.0.0.1:49986 127.0.0.1:53 ESTABLISHED 1601/frpc7
udp 0 0 127.0.0.1:37218 127.0.0.1:53 ESTABLISHED 1601/frpc7
udp 0 0 127.0.0.1:33396 127.0.0.1:53 ESTABLISHED 1601/frpc7
udp 0 0 127.0.0.1:47477 127.0.0.1:53 ESTABLISHED 1601/frpc7
udp 0 0 127.0.0.1:41589 127.0.0.1:53 ESTABLISHED 1601/frpc7
udp 0 0 127.0.0.1:49286 127.0.0.1:53 ESTABLISHED 1601/frpc7
udp 0 0 127.0.0.1:34965 127.0.0.1:53 ESTABLISHED 1601/frpc7
udp 0 0 127.0.0.1:52422 127.0.0.1:53 ESTABLISHED 1601/frpc7

Describe the results you expected:

Additional information you deem important (e.g. issue happens only occasionally):

Can you point out what caused this issue (optional)

Originally created by @thankeyes on GitHub (Mar 5, 2018). Original GitHub issue: https://github.com/fatedier/frp/issues/652 Issue is only used for submiting bug report and documents typo. If there are same issues or answers can be found in documents, we will close it directly. (为了节约时间,提高处理问题的效率,不按照格式填写的 issue 将会直接关闭。) Use the commands below to provide key information from your environment: You do NOT have to include this information if this is a FEATURE REQUEST **What version of frp are you using (./frpc -v or ./frps -v)?** 客户端服务端都是frp_0.16.0 **What operating system and processor architecture are you using (`go env`)?** 服务端是ubuntu14.04X64 客户端是K2P,openwrt **Configures you used:** ###frpc ######################## [common] server_addr = XXXXXXX server_port = 1505 ##heartbeat_interval = 2 ##heartbeat_timeout = 5 [udp1] type = udp local_ip = 127.0.0.1 local_port = 53 remote_port = 1553 ###frps ########################## [common] bind_port = 1505 **Steps to reproduce the issue:** 1.服务器udp1553监听了本地udp53端口 2.不断dig服务器1553端口(映射是完美运行的,可以dig通) 3.一大堆UDP ESTABLISHED残留在客户端不会消除(加了timeout参数也是不会消除) **Describe the results you received:** [root@pan:/root]#sh net|grep frp udp 0 0 127.0.0.1:52446 127.0.0.1:53 ESTABLISHED 1601/frpc7 udp 0 0 127.0.0.1:45294 127.0.0.1:53 ESTABLISHED 1601/frpc7 udp 0 0 127.0.0.1:49654 127.0.0.1:53 ESTABLISHED 1601/frpc7 udp 0 0 127.0.0.1:54017 127.0.0.1:53 ESTABLISHED 1601/frpc7 udp 0 0 127.0.0.1:54037 127.0.0.1:53 ESTABLISHED 1601/frpc7 udp 0 0 127.0.0.1:55844 127.0.0.1:53 ESTABLISHED 1601/frpc7 udp 0 0 127.0.0.1:49986 127.0.0.1:53 ESTABLISHED 1601/frpc7 udp 0 0 127.0.0.1:37218 127.0.0.1:53 ESTABLISHED 1601/frpc7 udp 0 0 127.0.0.1:33396 127.0.0.1:53 ESTABLISHED 1601/frpc7 udp 0 0 127.0.0.1:47477 127.0.0.1:53 ESTABLISHED 1601/frpc7 udp 0 0 127.0.0.1:41589 127.0.0.1:53 ESTABLISHED 1601/frpc7 udp 0 0 127.0.0.1:49286 127.0.0.1:53 ESTABLISHED 1601/frpc7 udp 0 0 127.0.0.1:34965 127.0.0.1:53 ESTABLISHED 1601/frpc7 udp 0 0 127.0.0.1:52422 127.0.0.1:53 ESTABLISHED 1601/frpc7 **Describe the results you expected:** **Additional information you deem important (e.g. issue happens only occasionally):** **Can you point out what caused this issue (optional)**
gitea-mirror 2026-05-05 12:19:57 -06:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@fatedier commented on GitHub (Mar 14, 2018):

不是很理解,udp 本身是没有连接的,不存在 ESTABLISHED 这种状态,你的查询命令不知道是什么。
可以尝试检查本地 53 端口的服务是否有问题,直接 dig 本地 53 端口,再通过你的方式查看这个状态。或者尝试设置 local_ip 和 local_port 为其他常见的 dns 服务器地址,发送多次请求后再查看状态,对比一下。

<!-- gh-comment-id:372919930 --> @fatedier commented on GitHub (Mar 14, 2018): 不是很理解,udp 本身是没有连接的,不存在 ESTABLISHED 这种状态,你的查询命令不知道是什么。 可以尝试检查本地 53 端口的服务是否有问题,直接 dig 本地 53 端口,再通过你的方式查看这个状态。或者尝试设置 local_ip 和 local_port 为其他常见的 dns 服务器地址,发送多次请求后再查看状态,对比一下。
Author
Owner

@thankeyes commented on GitHub (Mar 16, 2018):

可以dig通,转发是正常运行的,只是残留了这些ESTABLISHED一直存在不会消失,dig一次就会多一个

使用的命令是netstat -anplut

<!-- gh-comment-id:373870614 --> @thankeyes commented on GitHub (Mar 16, 2018): 可以dig通,转发是正常运行的,只是残留了这些ESTABLISHED一直存在不会消失,dig一次就会多一个 使用的命令是netstat -anplut
Author
Owner

@fatedier commented on GitHub (Mar 19, 2018):

确认问题,由于是转发的 udp,且 udp 没有连接,所以目前客户端发送了消息后,会一直等待读取消息,超时时间是 30s。原来这部分的处理没有释放资源,修改后应该 30s 后这个就看不到了。

<!-- gh-comment-id:374194040 --> @fatedier commented on GitHub (Mar 19, 2018): 确认问题,由于是转发的 udp,且 udp 没有连接,所以目前客户端发送了消息后,会一直等待读取消息,超时时间是 30s。原来这部分的处理没有释放资源,修改后应该 30s 后这个就看不到了。
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#509
No description provided.