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

A服务RPC调用B服务找不到可用地址时,导致当前线程上下文被清除,接着再调用C服务时取CSE上下文报空指针异常 #4569

Open
liuanxu opened this issue Oct 25, 2024 · 1 comment

Comments

@liuanxu
Copy link

liuanxu commented Oct 25, 2024

1、当前线程A服务代码中第73行使用RPC方式异步调用B服务:
业务逻辑调用

2、负载均衡没有找到B服务可用的地址:
负载均衡没有可用机器

3、A服务当前线程上下文被清除:
当前线程上下文被清除

4、A服务当前线程再接着调用C服务时,从上下文中获取参数时报空指针:
调B服务失败后再取上下文时报空指针异常

@liubao68
Copy link
Contributor

可以看下NPE的调用栈,一般是不恰当处理异步流程上下文设置导致的问题。 在异步回调中取上下文可能导致NPE,业务设计的时候需要理解下上下文传递的机制。

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