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

客户端关闭 #742

Open
qichangyu opened this issue Aug 23, 2018 · 1 comment
Open

客户端关闭 #742

qichangyu opened this issue Aug 23, 2018 · 1 comment

Comments

@qichangyu
Copy link

两个问题:
first:首先,服务端重启,然后客户端再次访问会发生channel closed 异常,此时重启客户端再次访问,不会再发生此类异常,原因排查, NettyChannelHandler channelDisconnected: remote=/10.31.24.33:47586 local=/10.31.24.33:8001 event=UpstreamChannelStateEvent
2018-08-23 17:37:17,277 INFO [New I/O worker #11] info - NettyChannelHandler channelDisconnected: remote=/10.31.24.33:47588 local=/10.31.24.33:8001 event=UpstreamChannelStateEvent
2018-08-23 17:37:17,278 INFO [New I/O worker #12] info - NettyChannelHandler channelConnected: remote=/10.31.24.33:49234 local=/10.31.24.33:8001 event=UpstreamChannelStateEvent
2018-08-23 17:37:17,278 INFO [New I/O worker #13] info - NettyChannelHandler channelConnected: remote=/10.31.24.33:49236 local=/10.31.24.33:8001 event=UpstreamChannelStateEvent

客户端启动会绑定到服务端,当端口号是随机的,当服务端重启,客户端再次调用的时候回发生channel closed,所以,当服务端重启的时候,客户端也需要重启~

second:默认的客户端连接时间不足以完成一次业务逻辑处理时间长的请求,需要增加请求时间,还有连接时间。

@rayzhang0603
Copy link
Collaborator

第一个问题,服务端重启时client端不需要重启,client在发送时,如果检测到链接不是alive时会新建链接,然后在发送请求。

如果是server突然出现问题重启,有可能会有部分请求发送失败或者等待返回结果超时;如果是正常的上线操作等,建议server端在做常规的上下线时,先关闭心跳开关,等注册中心状态变更为unavailable之后,在做停机重启。

第二个问题,超时时间请根据自身业务情况设置合适的requestTimeout

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

2 participants