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

如果因服务器崩溃导致login-status里的对应的账号没有删除掉,会不会导致用户重连报账号已登录 #69

Closed
nju-Nicko opened this issue Nov 4, 2019 · 2 comments
Labels
question Further information is requested

Comments

@nju-Nicko
Copy link

如题,目前用户的登录信息保存在login-status里,
image
可以看到这个k-v的ttl是-1,也就是没有设置失效时间。如果服务器崩溃导致没能正常清理这个login-status里的数据的话,客户端reconnect岂不是会报用户已登录了。
这边的高可靠性是否有考虑过。

@caydenprivate
Copy link

的确会有这个问题,目前只能是手动清除redis数据了

@crossoverJie crossoverJie added the question Further information is requested label Apr 15, 2020
@crossoverJie
Copy link
Owner

@nju-Nicko @caydenprivate

  1. 如果 server 只有一个节点,当服务器宕机或者网络不通时:客户端会执行下线和重连,但现在已经没有可以提供的服务了,所以客户端会自动关闭。

由于会调用下线接口,所有当服务可用时再启动客户端便会登录成功及创建连接。

  1. 如果 server 有多个节点,也会下线及重新选择一个可用节点创建连接。

所以不会出现这个问题,相关代码:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants