BurningCN commented on a change in pull request #9578:
URL: https://github.com/apache/dubbo/pull/9578#discussion_r786694058



##########
File path: 
dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/ForkingClusterInvoker.java
##########
@@ -86,6 +86,9 @@ public Result doInvoke(final Invocation invocation, 
List<Invoker<T>> invokers, L
                 URL consumerUrl = 
RpcContext.getServiceContext().getConsumerUrl();
                 executor.execute(() -> {
                     try {
+                        if (ref.size() > 0) {

Review comment:
       Very good, but the concurrency problem must be taken into account. 
Suppose that 10 threads execute this step and judge size=0. At this time, 
multiple elements will still be stored in the queue. The size judgment can use 
the atomic class, like the previous `final AtomicInteger count = new 
AtomicInteger();`




-- 
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