okumin commented on code in PR #5649:
URL: https://github.com/apache/hive/pull/5649#discussion_r1975482358


##########
ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMaterializedViewsRegistry.java:
##########
@@ -204,11 +205,21 @@ public void run() {
         } else {
           LOG.error("Problem connecting to the metastore when initializing the 
view registry", e);
         }
+      } finally {
+          cleanUpResources(ss);
       }
       perfLogger.perfLogEnd(CLASS_NAME, 
PerfLogger.MATERIALIZED_VIEWS_REGISTRY_REFRESH);
     }
   }
 
+  // Method to clean up the downloaded resources
+  private void cleanUpResources(SessionState sessionState) {
+    if (sessionState != null) {

Review Comment:
   I believe this is always non-null.



##########
ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMaterializedViewsRegistry.java:
##########
@@ -204,11 +205,21 @@ public void run() {
         } else {
           LOG.error("Problem connecting to the metastore when initializing the 
view registry", e);
         }
+      } finally {
+          cleanUpResources(ss);

Review Comment:
   I'm curious about what would happen if we closed `ss` using 
`SessionState#close`.



##########
service/src/java/org/apache/hive/service/cli/CLIService.java:
##########
@@ -133,6 +135,13 @@ private void applyAuthorizationConfigPolicy(HiveConf 
newHiveConf) throws HiveExc
     ss.setIsHiveServerQuery(true);
     SessionState.start(ss);
     ss.applyAuthorizationPolicy();

Review Comment:
   I slightly feel this `ss` can be immediately closed because this might be a 
hack to update `newHiveConf`



-- 
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-unsubscr...@hive.apache.org

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


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

Reply via email to