FrankYang0529 commented on code in PR #19817: URL: https://github.com/apache/kafka/pull/19817#discussion_r2173166538
########## shell/src/main/java/org/apache/kafka/shell/MetadataShell.java: ########## @@ -114,7 +114,7 @@ static FileLock takeDirectoryLock(File directory) throws IOException { "directory before proceeding."); } } catch (Throwable e) { - fileLock.destroy(); + fileLock.unlockAndClose(); Review Comment: IIUC, the MetadataShell only tries to do file lock when there is an `.lock` file. If there is a `.lock` file and the MetadataShell cannot acquire it, it means another process (probably server) holds it, so the MetadataShell cannot remove the file. https://github.com/apache/kafka/blob/05b6e81688846f77927a853b1181d7ff295c2e23/shell/src/main/java/org/apache/kafka/shell/MetadataShell.java#L97-L103 -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org