libenchao commented on code in PR #3567:
URL: https://github.com/apache/calcite/pull/3567#discussion_r1418237574


##########
core/src/main/java/org/apache/calcite/util/ReflectUtil.java:
##########
@@ -450,7 +450,8 @@ E extends Object> ReflectiveVisitDispatcher<R, E> 
createDispatcher(
         Method method = map.get(key);
         if (method == null) {
           if (map.containsKey(key)) {
-            // We already looked for the method and found nothing.
+            // We should get again because it may be putted an object by 
another thread.

Review Comment:
   You are right, adding synchronizing was in my first version. However, after 
looking at all the failure history, I only see the wrong result, not see the 
concurrent accessing exceptions, so I just proposed to add a minimal 
improvement without adding too much synchronizing burden to it.
   
   I don't have a strong opinion on it, if you think adding locking mechanism 
is a more thorough solution which we should do, I can change back to it.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to