danny0405 commented on code in PR #6242:
URL: https://github.com/apache/hudi/pull/6242#discussion_r933075366
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/transaction/lock/FileSystemBasedLockProvider.java:
##########
@@ -87,8 +87,13 @@ public boolean tryLock(long time, TimeUnit unit) {
try {
synchronized (LOCK_FILE_NAME) {
// Check whether lock is already expired, if so try to delete lock file
- if (fs.exists(this.lockFile) && checkIfExpired()) {
- fs.delete(this.lockFile, true);
+ if (fs.exists(this.lockFile)) {
+ if (checkIfExpired()) {
+ fs.delete(this.lockFile, true);
+ LOG.warn("Delete expired lock file: " + this.lockFile);
+ } else {
+ return false;
Review Comment:
It should be covered by `#testReentrantLock`
--
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]