You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "wecharyu (via GitHub)" <gi...@apache.org> on 2023/05/31 07:44:38 UTC

[GitHub] [hive] wecharyu commented on a diff in pull request #4366: HIVE-27386: Avoid duplicate audit log in cleanupHandlerContext

wecharyu commented on code in PR #4366:
URL: https://github.com/apache/hive/pull/4366#discussion_r1211230157


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java:
##########
@@ -182,8 +182,11 @@ static void cleanupHandlerContext() {
       HMSHandlerContext.getHMSHandler().ifPresent(handler -> {
         handler.notifyMetaListenersOnShutDown();
       });
-      HMSHandlerContext.clear();
-      logAndAudit("Done cleaning up thread local RawStore");
+      HMSHandlerContext.getRawStore().ifPresent(rs -> {
+        logAndAudit("Done cleaning up thread local RawStore");

Review Comment:
   I also had this discomfort before. What change my mind is that the audit log is related to only RawStore, and it was cleaned up here: https://github.com/apache/hive/blob/7bfc54ffc8baf5f3e7de326b750fe9355b11132b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java#L178-L179
   
   So I accepted this change, because `HMSHandlerContex.clear()` is for context rather than RawStore. Do you think we need reorder the log?



-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org