You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/05/24 04:01:40 UTC

[GitHub] [dubbo] shenjiaqing1 opened a new issue, #10078: dubbo RPC attachments java.util.ConcurrentModificationException

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

   ![截屏2022-05-24 上午11 58 32](https://user-images.githubusercontent.com/106133524/169946031-b8d411fd-2c4f-43a9-ba30-12b10647976c.png)
   ![image](https://user-images.githubusercontent.com/106133524/169946196-faeffd18-8c04-4ca8-b8e9-4334e938adcb.png)
   ![image](https://user-images.githubusercontent.com/106133524/169946289-c69a753c-1259-49fd-9c81-2cc5b360c50c.png)
   hashmap改成ConcurrentHashMap
   


-- 
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: notifications-unsubscribe@dubbo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] chickenlj closed issue #10078: dubbo RPC attachments java.util.ConcurrentModificationException

Posted by GitBox <gi...@apache.org>.
chickenlj closed issue #10078: dubbo RPC attachments java.util.ConcurrentModificationException
URL: https://github.com/apache/dubbo/issues/10078


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] shenjiaqing1 commented on issue #10078: dubbo RPC attachments java.util.ConcurrentModificationException

Posted by GitBox <gi...@apache.org>.
shenjiaqing1 commented on issue #10078:
URL: https://github.com/apache/dubbo/issues/10078#issuecomment-1135436215

   有两个条件,条件一是dubbo开启异步回调,条件二是高并发的情况下会存在非常小的概率发生这样的问题。线程1和线程2共享一个map,线程1在操作for循环的时候,线程2有一定的概率会修改与线程1共享的map。


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] chickenlj commented on issue #10078: dubbo RPC attachments java.util.ConcurrentModificationException

Posted by GitBox <gi...@apache.org>.
chickenlj commented on issue #10078:
URL: https://github.com/apache/dubbo/issues/10078#issuecomment-1135427924

   RpcInvocation 实例是在什么场景出现了被多线程共享的情况?


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] shenjiaqing1 commented on issue #10078: dubbo RPC attachments java.util.ConcurrentModificationException

Posted by GitBox <gi...@apache.org>.
shenjiaqing1 commented on issue #10078:
URL: https://github.com/apache/dubbo/issues/10078#issuecomment-1135460843

   > RpcInvocation 实例是在什么场景出现了被多线程共享的情况?
   
   ![image](https://user-images.githubusercontent.com/106133524/169962594-342b453b-ba21-4d54-8f91-202962c5a96e.png)
   我能理解为当存在同一个线程执行另外一个rpc调用的时候,就可能会发生前一个rpc异步回调的时候RpcContext被修改,是吗?


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] giraffe-tree commented on issue #10078: dubbo RPC attachments java.util.ConcurrentModificationException

Posted by "giraffe-tree (via GitHub)" <gi...@apache.org>.
giraffe-tree commented on issue #10078:
URL: https://github.com/apache/dubbo/issues/10078#issuecomment-1689630416

   我也遇到的这个问题
   consumer / provider 用的是都是 dubbo 2.7.9 
   ```
   org.apache.dubbo.rpc.RpcException: Failed to invoke the method inWithResult in the service xxxx.xxxxService. Tried 1 times of the providers [xxxx:17071] (1/68) from the registry xxxx:7400 on the consumer xxxx using the dubbo version 2.7.9. Last error is: null
           at org.apache.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:113)
           at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:265)
           at org.apache.dubbo.rpc.cluster.interceptor.ClusterInterceptor.intercept(ClusterInterceptor.java:47)
           at org.apache.dubbo.rpc.cluster.support.wrapper.AbstractCluster$InterceptorInvokerNode.invoke(AbstractCluster.java:92)
           at org.apache.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:93)
           at org.apache.dubbo.registry.integration.InterfaceCompatibleRegistryProtocol$MigrationInvoker.invoke(InterfaceCompatibleRegistryProtocol.java:132)
           at org.apache.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:83)
           at xxx 业务堆栈
           at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:774)
           at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:750)
           at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:488)
           at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1975)
           at org.apache.dubbo.rpc.protocol.dubbo.FutureAdapter.lambda$new$0(FutureAdapter.java:49)
           at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:774)
           at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:750)
           at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:488)
           at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1975)
           at org.apache.dubbo.remoting.exchange.support.DefaultFuture.doReceived(DefaultFuture.java:208)
           at org.apache.dubbo.remoting.exchange.support.DefaultFuture.received(DefaultFuture.java:175)
           at org.apache.dubbo.remoting.exchange.support.DefaultFuture.received(DefaultFuture.java:163)
           at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleResponse(HeaderExchangeHandler.java:60)
           at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:181)
           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 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.RpcInvocation.addObjectAttachments(RpcInvocation.java:337)
           at org.apache.dubbo.rpc.protocol.AbstractInvoker.invoke(AbstractInvoker.java:160)
           at org.apache.dubbo.rpc.protocol.AsyncToSyncInvoker.invoke(AsyncToSyncInvoker.java:52)
           at org.apache.dubbo.rpc.listener.ListenerInvokerWrapper.invoke(ListenerInvokerWrapper.java:78)
           at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:83)
           at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:83)
           at org.apache.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:89)
           at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:83)
           at org.apache.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:51)
           at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:83)
           at org.apache.dubbo.rpc.filter.ConsumerContextFilter.invoke(ConsumerContextFilter.java:69)
           at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:83)
           at org.apache.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:56)
           at org.apache.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:82)
   ```
   


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] shenjiaqing1 commented on issue #10078: dubbo RPC attachments java.util.ConcurrentModificationException

Posted by GitBox <gi...@apache.org>.
shenjiaqing1 commented on issue #10078:
URL: https://github.com/apache/dubbo/issues/10078#issuecomment-1135442892

   有两个条件,条件一是dubbo开启异步回调,条件二是高并发的情况下会存在非常小的概率发生这样的问题。线程1和线程2共享一个map,线程1在操作for循环的时候,线程2有一定的概率会修改与线程1共享的map。


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] shenjiaqing1 commented on issue #10078: dubbo RPC attachments java.util.ConcurrentModificationException

Posted by GitBox <gi...@apache.org>.
shenjiaqing1 commented on issue #10078:
URL: https://github.com/apache/dubbo/issues/10078#issuecomment-1135443151

   > RpcInvocation 实例是在什么场景出现了被多线程共享的情况?
   
   有两个条件,条件一是dubbo开启异步回调,条件二是高并发的情况下会存在非常小的概率发生这样的问题。线程1和线程2共享一个map,线程1在操作for循环的时候,线程2有一定的概率会修改与线程1共享的map。


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] CVnot commented on issue #10078: dubbo RPC attachments java.util.ConcurrentModificationException

Posted by "CVnot (via GitHub)" <gi...@apache.org>.
CVnot commented on issue #10078:
URL: https://github.com/apache/dubbo/issues/10078#issuecomment-1667682292

   > 就可能会发生前
   
   @chickenlj @shenjiaqing1 我理解这个地方不应该会有并发问题的,因为一个线程发起完请求之后,AsyncRpcResult中存储了一份Threadlocal的对象,并且在ContextFilter进行了remove,所以即使这个这个线程在接收到下一个请求的同时,上一个请求返回了,也不会修改一个对象的。我看的代码版本是2.7.18
   ![image](https://github.com/apache/dubbo/assets/40309483/21961d42-6553-49e4-b514-18f9b918973d)
   


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] CVnot commented on issue #10078: dubbo RPC attachments java.util.ConcurrentModificationException

Posted by "CVnot (via GitHub)" <gi...@apache.org>.
CVnot commented on issue #10078:
URL: https://github.com/apache/dubbo/issues/10078#issuecomment-1668832865

   > 
   
   我理解不会的,都是ThreadLocal的,上一个请求回来的对象和下一次请求的不是一个对象的,我们也遇到类似的问题,不过并不是这个地方


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org