CVnot opened a new issue, #12111:
URL: https://github.com/apache/dubbo/issues/12111

   最近线上出现了ConcurrentModificationException异常,dubbo版本是2.7.12
   dubbo链路是这样的,上游dubbo服务同步调用我们dubbo服务,我们的dubbo服务作为消费者再异步去调用下游的服务;
   
   类似这个issue:https://github.com/apache/dubbo/issues/6240
   我们怀疑是RpcServerContext 
ThreadLocal中的对象是被多个线程共享了,但是我们的代码没有任何地方使用这个,所以目前没啥思路,提到社区看看大家有没有什么解决思路,或者有类似的问题,感激不尽。
   
![image](https://user-images.githubusercontent.com/40309483/232448027-c9323e70-33d7-48bd-a41a-63912872a734.png)
   
   上游dubbo消费端(DubboInvoker)获取到的堆栈如下:
   Failed to invoke remote method: query, provider:...., 
   cause: java.util.concurrent.CompletionException: 
java.util.ConcurrentModificationException
   java.util.concurrent.CompletionException: 
java.util.ConcurrentModificationException
           at 
java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:292)
           at 
java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:308)
           at 
java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:769)
           at 
java.util.concurrent.CompletableFuture.uniWhenCompleteStage(CompletableFuture.java:778)
           at 
java.util.concurrent.CompletableFuture.whenComplete(CompletableFuture.java:2140)
           at 
org.apache.dubbo.rpc.AsyncRpcResult.whenCompleteWithContext(AsyncRpcResult.java:195)
           at 
org.apache.dubbo.rpc.protocol.FilterNode.invoke(FilterNode.java:81)
           at 
org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:146)
           at 
org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:100)
           at 
org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:175)
           at 
org.apache.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:51)
           at 
org.apache.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:57)
           at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
           at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
           at 
org.apache.dubbo.common.threadlocal.InternalRunnable.run(InternalRunnable.java:41)
           at java.lang.Thread.run(Thread.java:748)
   Caused by: java.util.ConcurrentModificationException
           at java.util.HashMap$HashIterator.nextNode(HashMap.java:1445)
           at java.util.HashMap$EntryIterator.next(HashMap.java:1479)
           at java.util.HashMap$EntryIterator.next(HashMap.java:1477)
           at java.util.HashMap.putMapEntries(HashMap.java:512)
           at java.util.HashMap.putAll(HashMap.java:785)
           at 
org.apache.dubbo.rpc.AppResponse.addObjectAttachments(AppResponse.java:164)
           at 
org.apache.dubbo.rpc.filter.ContextFilter.onResponse(ContextFilter.java:141)
                  at 
org.apache.dubbo.rpc.protocol.FilterNode.lambda$invoke$0(FilterNode.java:99)
           at 
org.apache.dubbo.rpc.AsyncRpcResult.lambda$whenCompleteWithContext$0(AsyncRpcResult.java:197)
           at 
java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:760)
           ... 13 more
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to