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



##########
File path: 
oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/TraceSegmentSampler.java
##########
@@ -18,18 +18,20 @@
 
 package 
org.apache.skywalking.oap.server.receiver.trace.provider.parser.listener;
 
+import 
org.apache.skywalking.oap.server.receiver.trace.provider.TraceServiceModuleConfig;
+
 /**
  * The sampler makes the sampling mechanism works at backend side. Sample 
result: [0,sampleRate) sampled, (sampleRate,~)
  * ignored
  */
 public class TraceSegmentSampler {
-    private int sampleRate = 10000;
+    private TraceServiceModuleConfig config;

Review comment:
       As `TraceServiceModuleConfig#sampleRate` could be changed across thread, 
recommend to add `volatile`
   
   > private volatile int sampleRate = 10000;
   
   Just for avoiding unexpected behaviour.




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