Linux FIN_WAIT_1 状态出现问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10890247/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Trouble on state FIN_WAIT_1
提问by wing2ofsky
recently i've got some port holding on FIN_WAIT_1state till two days later. The target port is used by one server process ever and client connect to the server process through this port.
最近我有一些端口保持FIN_WAIT_1状态直到两天后。目标端口一直被一个服务器进程使用,客户端通过这个端口连接到服务器进程。
The situation is we stopped the server process, and obviously some client is still connecting with the server at that moment. From my understanding, the server process sends a FIN package to client and waiting for the ACK package back. Unfortunately, that ACK package seems not like coming to server side till two days later.
情况是我们停止了服务器进程,显然此时某些客户端仍在与服务器连接。据我了解,服务器进程向客户端发送了一个 FIN 包,等待 ACK 包回来。不幸的是,该 ACK 包似乎直到两天后才出现在服务器端。
my question is there any config like timeout to FIN_WAIT_1status. i walked through the internet searching but found nothing there. Please help tell me if you have any experience with this.
我的问题是有没有像FIN_WAIT_1状态超时这样的配置。我在互联网上搜索,但一无所获。如果您有这方面的经验,请帮助告诉我。
BTW, the server process has already gone while the FIN_WAIT_1 happening to the port.
顺便说一句,当 FIN_WAIT_1 发生在端口上时,服务器进程已经消失了。
Thanks in advance
提前致谢
采纳答案by user207421
The FIN_WAIT_1
state is waiting for the peer to ACK
the FIN
that this end has just sent. That outgoing FIN
is subject to all the normal TCP retry and timeout processing, so if the other end has completely disappeared and never responds, TCP should time out the connection and reset it as a matter of course. That's why you couldn't find a specific FIN_WAIT_1
timeout: there isn't one, just the normal TCP write timers.
该FIN_WAIT_1
州正在等待对方来ACK
的FIN
是为此刚刚发。那个传出FIN
要经过所有正常的 TCP 重试和超时处理,所以如果另一端已经完全消失并且从不响应,TCP 应该将连接超时并重置它理所当然。这就是您找不到特定FIN_WAIT_1
超时的原因:没有超时,只有普通的 TCP 写入计时器。
All that should have happened within ten minutes or so.
这一切都应该在十分钟左右发生。
If the state persists and it causes other problems I don't think you don't have much option but to reboot.
如果状态持续存在并导致其他问题,我认为您别无选择,只能重新启动。
回答by snowsnoot
Are you sure it's the same ports stuck in FIN_WAIT? It could be due to a load balancer or NAT device that is dropping the connections after an inactivity timeout and silently discarding any further packets, which is the default behavior on some devices.
您确定它是卡在 FIN_WAIT 中的相同端口吗?这可能是由于负载平衡器或 NAT 设备在不活动超时后丢弃连接并静默丢弃任何其他数据包,这是某些设备上的默认行为。