jerryshao commented on code in PR #14407:
URL: https://github.com/apache/gravitino/pull/14407#discussion_r4582971605


##########
catalogs/hadoop-common/src/main/java/org/apache/gravitino/catalog/hadoop/fs/HDFSFileSystemProxy.java:
##########
@@ -182,6 +245,69 @@ private synchronized void close() {
       }
       kerberosClient = null;
     }
+    if (keytabFile != null) {
+      try {
+        Files.deleteIfExists(keytabFile.toPath());
+      } catch (IOException | RuntimeException e) {
+        LOG.warn("Failed to delete the keytab file {}", keytabFile, e);
+      }
+      LIVE_KEYTAB_FILES.remove(keytabFile);

Review Comment:
   [P2] If keytab deletion fails during close(), this unconditional removal 
prevents the shutdown hook from retrying, even if directory permissions recover 
before exit. Since this path now uses fetchKeytabFromUri() instead of 
saveKeytabFromUri(), there is no deleteOnExit fallback. Please move 
LIVE_KEYTAB_FILES.remove(keytabFile) into the try block after successful 
deleteIfExists(), and add a regression covering deletion failure followed by 
successful shutdown cleanup.



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