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

日志信息缺少关键的错误地址信息 #54

Closed
uvletter opened this issue Feb 5, 2018 · 6 comments
Closed

日志信息缺少关键的错误地址信息 #54

uvletter opened this issue Feb 5, 2018 · 6 comments

Comments

@uvletter
Copy link

uvletter commented Feb 5, 2018

建议在failover策略的错误日志中加上对请求主机地址的记录,方便在生产环境下快速排查和恢复错误。
dubbo的记录信息如下,我觉得是比较合理的。

logger.warn("Although retry the method " + invocation.getMethodName()
                            + " in the service " + getInterface().getName()
                            + " was successful by the provider " + invoker.getUrl().getAddress()
                            + ", but there have been failed providers " + providers
                            + " (" + providers.size() + "/" + copyinvokers.size()
                            + ") from the registry " + directory.getUrl().getAddress()
                            + " on the consumer " + NetUtils.getLocalHost()
                            + " using the dubbo version " + Version.getVersion() + ". Last error is: "
                            + le.getMessage(), le);
@fengjiachun
Copy link
Owner

恩 已在日志中增加 请求主机地址的记录, 近期会提交代码

@fengjiachun
Copy link
Owner

感谢

@fengjiachun
Copy link
Owner

@uvletter done

@uvletter
Copy link
Author

uvletter commented Feb 8, 2018

现在的代码已经OK,不过failover不支持多播,那dispatch返回的必然是DefaultInvokeFuture,所以那一次类型判断是多余的。原谅我的代码洁癖orz

@uvletter uvletter closed this as completed Feb 8, 2018
@uvletter
Copy link
Author

uvletter commented Feb 8, 2018

不过以后对InvokeFuture接口可能有新的实现类,你这个处理没问题。

@fengjiachun
Copy link
Owner

@uvletter 类型判断就是个防御性质, 避免未来Future这块有改动导致这里出现了cast异常

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants