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



##########
File path: 
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/ids/GlobalIdGenerator.java
##########
@@ -73,9 +73,19 @@ private long timestamp() {
             long currentTimeMillis = System.currentTimeMillis();
 
             if (currentTimeMillis < lastTimestamp) {
+                long overTime = lastTimestamp - currentTimeMillis;
+                if (overTime <= 5) {
+                    try {
+                        Thread.sleep(overTime);

Review comment:
       This could face concurrency status, `lastShiftValue++` could be the same 
in different threads.




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