Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

服务端, 客户端运行几个小时后会停止工作. 需要重启 客户端. #422

Closed
sunuslee opened this issue Mar 22, 2017 · 8 comments

Comments

@sunuslee
Copy link

sunuslee commented Mar 22, 2017

hi, @xtaci 首先我用这个项目用得很爽, 感谢, 赞一个!
最近一段时间, 我注意到有一个问题, 不知道如何改善, 表现就是运行一段时间后, 客户端, 服务端均停止工作. 以下是日志, 这次我留了个现场:)

server 的日期 +8小时和 client 一一对应.

server, ver 20170221

/root/kcp/server_linux_amd64 -t server.ip:8989 -l :4000 -mode fast2 -sndwnd 1536 --log /var/log/kcp.log
2017/03/22 05:27:27 stream opened
2017/03/22 05:27:27 stream opened
2017/03/22 05:30:37 stream closed
2017/03/22 05:30:37 stream opened
2017/03/22 05:31:39 stream closed
2017/03/22 05:31:52 stream closed
2017/03/22 05:32:20 stream opened
2017/03/22 05:34:38 stream closed
2017/03/22 05:36:20 stream closed
2017/03/22 05:36:22 stream opened
2017/03/22 05:36:50 stream opened
2017/03/22 05:40:23 stream closed
2017/03/22 05:40:51 stream closed
2017/03/22 05:47:01 stream opened
2017/03/22 05:48:48 stream opened
2017/03/22 05:51:02 stream closed
2017/03/22 05:52:40 stream opened
2017/03/22 05:52:48 stream closed
2017/03/22 05:55:54 stream opened
2017/03/22 05:55:55 stream opened
2017/03/22 05:55:56 stream opened
2017/03/22 05:56:03 stream opened
2017/03/22 05:56:11 stream closed
2017/03/22 05:56:11 stream opened
2017/03/22 05:56:40 stream closed
2017/03/22 06:00:04 stream closed
2017/03/22 06:00:12 stream closed
2017/03/22 06:00:19 stream closed
2017/03/22 06:01:09 stream closed
2017/03/22 06:01:57 broken pipe

client , ver 20170221

./client_darwin_amd64 -r "server.ip:4000" -l ":8989" -mode fast2 -rcvwnd 1536
2017/03/22 14:01:15 stream opened
2017/03/22 14:01:15 stream opened
2017/03/22 14:01:15 stream opened
2017/03/22 14:01:15 stream opened
2017/03/22 14:01:16 stream opened
2017/03/22 14:01:25 stream closed
2017/03/22 14:01:25 stream opened
2017/03/22 14:01:25 stream closed
2017/03/22 14:01:25 stream closed
2017/03/22 14:01:25 stream closed
2017/03/22 14:01:25 stream opened
2017/03/22 14:01:25 stream opened
2017/03/22 14:01:26 stream closed
2017/03/22 14:01:26 stream opened
2017/03/22 14:01:29 stream closed
2017/03/22 14:01:29 stream closed
2017/03/22 14:01:29 stream closed
2017/03/22 14:01:29 stream closed
2017/03/22 14:02:22 session marked as expired
2017/03/22 14:02:22 connection: client.ip:63642 -> server.ip:4000
2017/03/22 14:02:22 stream opened
2017/03/22 14:02:23 session normally closed
2017/03/22 14:02:32 stream closed
2017/03/22 14:02:32 stream opened
2017/03/22 14:02:42 stream closed
2017/03/22 14:02:42 stream opened
2017/03/22 14:02:52 stream closed
2017/03/22 14:02:52 session marked as expired
2017/03/22 14:02:52 connection: client.ip:51745 -> server.ip:4000
2017/03/22 14:02:52 stream opened
2017/03/22 14:02:53 session normally closed
2017/03/22 14:03:02 stream closed
2017/03/22 14:03:08 stream opened
2017/03/22 14:03:10 stream opened
2017/03/22 14:03:10 stream opened
2017/03/22 14:03:10 stream opened

PS, 实际运行时间有几个小时, 日志只是取的是最后几十条. 并且该问题出现后 , 客户端, 服务端均不再输出新的日志.
目前怀疑的点如下:

server

2017/03/22 06:01:57 broken pipe

client

2017/03/22 14:01:29 stream closed
2017/03/22 14:02:22 session marked as expired
2017/03/22 14:02:22 connection: client.ip:63642 -> server.ip:4000
2017/03/22 14:02:22 stream opened
2017/03/22 14:02:23 session normally closed
2017/03/22 14:02:32 stream closed
2017/03/22 14:02:32 stream opened
2017/03/22 14:02:42 stream closed
2017/03/22 14:02:42 stream opened
2017/03/22 14:02:52 stream closed
2017/03/22 14:02:52 session marked as expired
2017/03/22 14:02:52 connection: client.ip:51745 -> server.ip:4000
2017/03/22 14:02:52 stream opened
2017/03/22 14:02:53 session normally closed
2017/03/22 14:03:02 stream closed
2017/03/22 14:03:08 stream opened
2017/03/22 14:03:10 stream opened
2017/03/22 14:03:10 stream opened
2017/03/22 14:03:10 stream opened

不知是我遗漏了什么, 还是有什么办法可以修复该问题, 多谢!
UPDATE: 我这次又确认了一下, 重启客户端即可恢复.

@xtaci
Copy link
Owner

xtaci commented Mar 22, 2017

可以试试最新的看有没有解决,可能是ISP的问题,也可能是某个bug导致的。

@sunuslee
Copy link
Author

@xtaci OK
我现在已经在使用0322版本. 先观察. 不出意外今明两天可以反馈结果.

@keeno1982
Copy link

我也遇到这个问题,频繁出现session marked as expired,session normally closed,用的是20170322版本

@xtaci
Copy link
Owner

xtaci commented Mar 23, 2017

session marked as expired
session normally closed
session reached scavenge ttl

都是由于-autoexpire设置产生的正常连接切换中断。

@sunuslee
Copy link
Author

@xtaci 但是你可以看看我的启动参数. 应该没设置-autoexpire
那么应该是使用默认的 -autoexpire 0 吧?

@xtaci
Copy link
Owner

xtaci commented Mar 23, 2017

没有设置就是真的连接中断了。

@keeno1982
Copy link

-l xxx.xxx.xxx.xxx:9527 -r xxx.xxx.xxx.xxx:555 -key "xxxxxx" -crypt salsa20 -nocomp true -mtu 1350 -sndwnd 245 -rcvwnd 614 -mode fast3,我就是这几个参数,也没有用到-autoexpire

@xtaci xtaci closed this as completed Mar 23, 2017
@sunuslee sunuslee changed the title 服务端, 客户端运行几个小时后会停止工作. 需要重启服务端, 客户端. 服务端, 客户端运行几个小时后会停止工作. 需要重启 客户端. Mar 23, 2017
@Originalimoc
Copy link

还有个可能。
检查一下iptables是否有影响建立链接的选项。

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

No branches or pull requests

4 participants