danny0405 commented on code in PR #12982:
URL: https://github.com/apache/hudi/pull/12982#discussion_r2025854536


##########
hudi-common/src/main/java/org/apache/hudi/common/table/view/AbstractTableFileSystemView.java:
##########
@@ -1589,8 +1582,13 @@ protected Option<HoodieBaseFile> 
fetchLatestBaseFile(String partitionPath, Strin
    * @return File Slice if present
    */
   public Option<FileSlice> fetchLatestFileSlice(String partitionPath, String 
fileId) {
-    return Option
-        .fromJavaOptional(fetchLatestFileSlices(partitionPath).filter(fs -> 
fs.getFileId().equals(fileId)).findFirst());
+    try {
+      readLock.lock();
+      return Option
+          .fromJavaOptional(fetchLatestFileSlices(partitionPath).filter(fs -> 
fs.getFileId().equals(fileId)).findFirst());

Review Comment:
   Isn't the read lock already acquired in line 1588?



-- 
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]

Reply via email to