wu-sheng commented on a change in pull request #6009:
URL: https://github.com/apache/skywalking/pull/6009#discussion_r543129416



##########
File path: 
apm-commons/apm-datacarrier/src/main/java/org/apache/skywalking/apm/commons/datacarrier/consumer/MultipleChannelsConsumer.java
##########
@@ -30,13 +32,12 @@
 public class MultipleChannelsConsumer extends Thread {
     private volatile boolean running;
     private volatile ArrayList<Group> consumeTargets;
-    @SuppressWarnings("NonAtomicVolatileUpdate")
-    private volatile long size;
+    private final AtomicLong size = new AtomicLong();

Review comment:
       We are trying to avoid any possible lock, it is also slower, more or 
less. That is why it may be not a good idea.
   SkyWalking codes are for product environment and high performance, we have 
no plan to use the codes to guide people how to write codes.
   
   So, the key is, if the current version of codes has a bug, we are open to 
the solution.




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

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


Reply via email to