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


##########
hudi-timeline-service/src/main/java/org/apache/hudi/timeline/service/RequestHandler.java:
##########
@@ -151,30 +156,38 @@ public void stop() {
    * Determines if local view of table's timeline is behind that of client's 
view.
    */
   private boolean isLocalViewBehind(Context ctx) {
-    String basePath = 
ctx.queryParam(RemoteHoodieTableFileSystemView.BASEPATH_PARAM);
-    String lastKnownInstantFromClient =
-        ctx.queryParamAsClass(RemoteHoodieTableFileSystemView.LAST_INSTANT_TS, 
String.class).getOrDefault(HoodieTimeline.INVALID_INSTANT_TS);
-    String timelineHashFromClient = 
ctx.queryParamAsClass(RemoteHoodieTableFileSystemView.TIMELINE_HASH, 
String.class).getOrDefault("");
-    HoodieTimeline localTimeline =
-        
viewManager.getFileSystemView(basePath).getTimeline().filterCompletedOrMajorOrMinorCompactionInstants();
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("Client [ LastTs=" + lastKnownInstantFromClient + ", 
TimelineHash=" + timelineHashFromClient
-          + "], localTimeline=" + localTimeline.getInstants());
-    }
+    try {
+      // This read lock makes sure that if the local view of the table is 
being synced,
+      // no timeline server requests should be processed or handled until the 
sync process

Review Comment:
   Don't think we need a explicit lock obj again, the whole code block is 
guarded by a `synchronized` object lock.



-- 
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: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to