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 2020/05/15 15:09:00 UTC

[GitHub] [skywalking] kezhenxu94 commented on pull request #4791: fix: fix double-checked locking bug

kezhenxu94 commented on pull request #4791:
URL: https://github.com/apache/skywalking/pull/4791#issuecomment-629289548


   > It is not necessary, i will close this pr.
   > Thank you for your reply.
   
   @RobotZhong technically speaking it's indeed a bug, although it seldom happens in production, fixing this is a good first step for you to go through the contribution process in this project and for further contributions, if you will.
   
   Let's go back to the problem itself, there're multiple fixes in my mind, but initiating it eagerly seems to fit this case most, `FileWriter` is mostly always used in production, `volatile` makes it always loaded from the memory in every call, and thus does more harm than good. @wu-sheng's suggestion "with inner static holder" also makes sense to me


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