1
0

[HUDI-3394] Check isWriteLockedByCurrentThread before unlock for InProcessLockProvider (#4819)

Co-authored-by: yuezhang <yuezhang@freewheel.tv>
Co-authored-by: Y Ethan Guo <ethan.guoyihua@gmail.com>
This commit is contained in:
YueZhang
2022-02-16 14:41:25 +08:00
committed by GitHub
parent 9a05940a74
commit 3363c66468
4 changed files with 14 additions and 5 deletions

View File

@@ -238,7 +238,7 @@ public class TestInProcessLockProvider {
assertDoesNotThrow(() -> {
inProcessLockProvider.unlock();
});
assertThrows(HoodieLockException.class, () -> {
assertDoesNotThrow(() -> {
inProcessLockProvider.unlock();
});
}
@@ -246,7 +246,7 @@ public class TestInProcessLockProvider {
@Test
public void testUnlockWithoutLock() {
InProcessLockProvider inProcessLockProvider = new InProcessLockProvider(lockConfiguration, hadoopConfiguration);
assertThrows(HoodieLockException.class, () -> {
assertDoesNotThrow(() -> {
inProcessLockProvider.unlock();
});
}

View File

@@ -81,7 +81,7 @@ public class TestTransactionManager extends HoodieCommonTestHarness {
});
transactionManager.endTransaction();
assertThrows(HoodieLockException.class, () -> {
assertDoesNotThrow(() -> {
transactionManager.endTransaction();
});
}