You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/04/12 01:13:46 UTC

[GitHub] [skywalking] wu-sheng commented on a change in pull request #6729: GlobalIdGenerator will produce a negative id when the time shift back

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



##########
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:
       We can't afford this sleep. 




-- 
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:
users@infra.apache.org