Skip to content

Commit 084f808

Browse files
committed
improve log message for lock file deletion
1 parent c08133e commit 084f808

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

affinity/src/main/java/net/openhft/affinity/lockchecker/FileLockBasedLockChecker.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,11 @@ private boolean isLockFree(File file, int id) {
7070
}
7171

7272
//file is present but nobody has it locked - delete it
73-
LOGGER.info(String.format("Deleting %s as nobody has the lock", file.getAbsolutePath()));
74-
file.delete();
73+
boolean deleted = file.delete();
74+
if (deleted)
75+
LOGGER.info(String.format("Deleted %s as nobody has the lock", file.getAbsolutePath()));
76+
else
77+
LOGGER.warn(String.format("Nobody has the lock on %s. Delete failed", file.getAbsolutePath()));
7578

7679
return true;
7780
}

0 commit comments

Comments
 (0)