FrankYang0529 commented on code in PR #15568:
URL: https://github.com/apache/kafka/pull/15568#discussion_r1533196551


##########
core/src/main/scala/kafka/utils/FileLock.scala:
##########
@@ -65,8 +65,14 @@ class FileLock(val file: File) extends Logging {
   def unlock(): Unit = {
     this synchronized {
       trace(s"Releasing lock on ${file.getAbsolutePath}")
-      if (flock != null)
+      if (flock != null) {
         flock.release()
+        if (file.delete()) {
+          trace(s"Deleted ${file.getAbsolutePath}")
+        } else {
+          warn(s"Could not delete ${file.getAbsolutePath}")
+        }

Review Comment:
   Agree! Deleting the file in `destroy` makes sense to me. I will update it.



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

Reply via email to