stream2000 commented on code in PR #10197:
URL: https://github.com/apache/hudi/pull/10197#discussion_r1427521187
##########
hudi-common/src/main/java/org/apache/hudi/common/table/view/AbstractTableFileSystemView.java:
##########
@@ -302,19 +295,20 @@ public void close() {
@Override
public void reset() {
try {
- writeLock.lock();
+ viewLock.writeLock();
clear();
// Initialize with new Hoodie timeline.
init(metaClient, getTimeline());
} finally {
- writeLock.unlock();
+ viewLock.writeUnlock();
}
}
/**
* Clear the resource.
*/
protected void clear() {
+ assert viewLock.hasWriteLock();
Review Comment:
We can use `ValidationUtils.checkArgument` to check the result here.
e.g.,
ValidationUtils.checkArgument(viewLock.hasWriteLock(), "Current thread must
hold the write lock on viewLock when clearing the resource");
--
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]