[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:
@@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class TestTransactionManager extends HoodieCommonTestHarness {
|
||||
});
|
||||
|
||||
transactionManager.endTransaction();
|
||||
assertThrows(HoodieLockException.class, () -> {
|
||||
assertDoesNotThrow(() -> {
|
||||
transactionManager.endTransaction();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user