TomMD commented on a change in pull request #6103:
URL: https://github.com/apache/skywalking/pull/6103#discussion_r550272812



##########
File path: 
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/plugin/WitnessClassFinder.java
##########
@@ -36,6 +36,17 @@
      * @return true, if the given witnessClass exists, through the given 
classLoader.
      */
     public boolean exist(String witnessClass, ClassLoader classLoader) {
+        return getResolution(witnessClass, classLoader)

Review comment:
       @wu-sheng I don't believe you miss anything, it's merely a difference of 
what one considers a race.  If you `get` from a variable outside of 
synchronized, and that variable is sometimes used in a `synchronized` block 
then you receive this read/write race warning.
   
   Your read might race with a write because the lock isn't held.  You are 
probably unconcerned and can quickly dismiss the warning in this case.  The 
link you posted suggests you are concern is about races regarding the handling 
of the hashmap itself (i.e. the collision and resize issues in the answer) and 
it suffices to avoid write/write races.
   
   I believe in practice read/write races are concerning almost exclusively in 
multi-variable situations where there are invariants between the variables that 
are broken within the writers so the readers must ensure they see a consistent 
state, usually with a lock.




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