From 695887f5d0836b5670d713fc57ba813f163be635 Mon Sep 17 00:00:00 2001 From: Sivabalan Narayanan Date: Sat, 18 Dec 2021 08:23:31 -0800 Subject: [PATCH] Fixing a bug in TransactionManager and FileSystemTestLock --- .../transaction/FileSystemBasedLockProviderTestClass.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hudi-client/hudi-client-common/src/test/java/org/apache/hudi/client/transaction/FileSystemBasedLockProviderTestClass.java b/hudi-client/hudi-client-common/src/test/java/org/apache/hudi/client/transaction/FileSystemBasedLockProviderTestClass.java index 702a84a97b300..2fc6ba4aa0853 100644 --- a/hudi-client/hudi-client-common/src/test/java/org/apache/hudi/client/transaction/FileSystemBasedLockProviderTestClass.java +++ b/hudi-client/hudi-client-common/src/test/java/org/apache/hudi/client/transaction/FileSystemBasedLockProviderTestClass.java @@ -76,7 +76,7 @@ public boolean tryLock(long time, TimeUnit unit) { try { int numRetries = 0; while (fs.exists(new Path(lockPath + "/" + LOCK_NAME)) - && (numRetries <= lockConfiguration.getConfig().getInteger(LOCK_ACQUIRE_NUM_RETRIES_PROP_KEY))) { + && (numRetries++ <= lockConfiguration.getConfig().getInteger(LOCK_ACQUIRE_NUM_RETRIES_PROP_KEY))) { Thread.sleep(lockConfiguration.getConfig().getInteger(LOCK_ACQUIRE_RETRY_WAIT_TIME_IN_MILLIS_PROP_KEY)); } synchronized (LOCK_NAME) {