nickwongwong commented on a change in pull request #6729:
URL: https://github.com/apache/skywalking/pull/6729#discussion_r611630197



##########
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:
       
![image](https://user-images.githubusercontent.com/16626084/114402077-13a7c200-9bd6-11eb-8ba5-7d36111d0efe.png)
   
![image](https://user-images.githubusercontent.com/16626084/114402341-4f428c00-9bd6-11eb-9af8-f1e605bcd631.png)
   
   `ThreadLocal` means every thread hold different `IDContext`.

##########
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:
       
![image](https://user-images.githubusercontent.com/16626084/114402077-13a7c200-9bd6-11eb-8ba5-7d36111d0efe.png)
   
![image](https://user-images.githubusercontent.com/16626084/114402341-4f428c00-9bd6-11eb-9af8-f1e605bcd631.png)
   
   `ThreadLocal` means every thread holds a different `IDContext`.




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