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

请求连接超时如何获取ip #118

Closed
zqfan opened this issue Sep 3, 2020 · 2 comments · Fixed by #120
Closed

请求连接超时如何获取ip #118

zqfan opened this issue Sep 3, 2020 · 2 comments · Fixed by #120

Comments

@zqfan
Copy link
Contributor

zqfan commented Sep 3, 2020

https://github.com/TarsCloud/TarsCpp/blob/master/servant/libservant/ServantProxy.cpp#L793
这里是成功了才设置szhost,为什么不无论成功失败都设置呢?
如果确实不能设置,请问如何获取到连接超时的对端ip呢?

zqfan added a commit to zqfan/TarsCpp that referenced this issue Sep 6, 2020
@FanFansfan
Copy link

FanFansfan commented Sep 8, 2020

超时有可能是拿不到可用节点导致的,由于首次调用可能是节点列表返回后再触发的,这个时候请求在等待队列内超时了,也就没有对端IP了,注意此时AdapterPrx == nullptr。

@zqfan
Copy link
Contributor Author

zqfan commented Sep 10, 2020

可是也有拿到了节点列表但是就是链接超时,此时需要知道这个ip,以便于旁路发出告警,记录日志等。现在一刀切,导致有个节点挂掉了,但是日志里没法获取,只能从报错的字符串中尝试正则匹配ip,也太丑陋了

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

Successfully merging a pull request may close this issue.

2 participants