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

rpc_client 中call_back函数(rcp_client.hpp 638行)的assert(f)被触发的原因是什么 #137

Open
sdoa5335717 opened this issue Mar 28, 2024 · 1 comment

Comments

@sdoa5335717
Copy link

我在使用客户端的过程中assert(f)被触发了,导致程序退出,应用场景如下
1, 客户端有一个不断向服务端发送数据的功能,可以理解为自定义心跳。
2, 当自定义心跳超时的时候,客户端主动关闭连接,然后调用connect再进行重连。
3, 问题就出现在当自定义心跳超时后,assert(f)有时候就会被触发,程序就退出了。

我理解的是因为close的调用,导致future_map_被清空了,auto &f = future_map_[req_id]的f为空。这里的assert(f)能否改成if(f) {f->set_value()}?

@qicosmos
Copy link
Owner

这个问题应该fix 过了,你用master 代码测一下吧。

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