We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
业务最近拓展了handler,并在handler里将一个hashmap存在invocation里。然后将此handler放到了consumer下。我们压测A微服务调B微服务,我们发现,A微服务在上述新增handler里存入hashmap后,在clientFilter里偶现取不到这个hashmap里的某些value。我们怀疑这个hashmap被其他线程改了,将hashmap改为concurrentHashMap后,问题解决。请问下,并发场景下,这个handler是被所有线程持有共享,还是每个线程单独持有的?
The text was updated successfully, but these errors were encountered:
public interface Handler { void handle(Invocation invocation, AsyncResponse asyncResp) throws Exception; }
handler是会被多线程访问的,需要业务保证线程安全。 Invocation是关联某个请求的,只会被这个请求的执行流程访问,也就是不会出现多线程的情况。
Invocation
可能需要你提供一个简单的DEMO描述下你的场景,才能理解你的问题。
Sorry, something went wrong.
No branches or pull requests
业务最近拓展了handler,并在handler里将一个hashmap存在invocation里。然后将此handler放到了consumer下。我们压测A微服务调B微服务,我们发现,A微服务在上述新增handler里存入hashmap后,在clientFilter里偶现取不到这个hashmap里的某些value。我们怀疑这个hashmap被其他线程改了,将hashmap改为concurrentHashMap后,问题解决。请问下,并发场景下,这个handler是被所有线程持有共享,还是每个线程单独持有的?
The text was updated successfully, but these errors were encountered: