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


##########
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:
   The multi-threading comes from tests concurrent running, and they share a 
singleton `ServerDdlExecutor`, which will result concurrent accessing here.
   
   I agree that adding `synchronized` is a better choice, since we already have 
some similar usages such as in `JaninoRelMetadataProvider`.



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