nickwongwong commented on issue #6728:
URL: https://github.com/apache/skywalking/issues/6728#issuecomment-817335610


   
![image](https://user-images.githubusercontent.com/16626084/114312375-08e12480-9b25-11eb-9571-10ddddd7b29a.png)
   It may produce a conflict timestamp while using random.
   I have a new solution for the time-shift-back, inspiring by `sonyflake`.
   
https://github.com/sony/sonyflake/blob/848d664ceea4c980874f2135c85c42409c530b1f/sonyflake.go#L96-L103
   
   After considering performance and safety, sleep some ms when `overtime` is 
less than 5ms. 
   Use random integer when  `overtime` is more than 5ms.
   
   Please review my new PR.


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