singhpk234 commented on code in PR #14629:
URL: https://github.com/apache/iceberg/pull/14629#discussion_r2542575946


##########
core/src/main/java/org/apache/iceberg/rest/CatalogHandlers.java:
##########
@@ -777,6 +774,9 @@ private static void planFilesFor(TableScan tableScan, 
String planId, int tasksPe
 
   private static void asyncPlanFiles(
       TableScan tableScan, String asyncPlanId, int tasksPerPlanTask) {
-    ASYNC_PLANNING_POOL.execute(() -> planFilesFor(tableScan, asyncPlanId, 
tasksPerPlanTask));
+    // Its not necessary to run this in a separate thread pool, but doing so
+    // will create a race condition where a client can call fetchPlanningResult
+    // even before the IN_MEMORY_PLANNING_STATE has been populated.
+    planFilesFor(tableScan, asyncPlanId, tasksPerPlanTask);

Review Comment:
   It is still async in a sense that the plan endpoint says submitted status 
only, meanwhile populating the IN_MEMORY_PLANNING_STATE, when the client comes 
back with fetchPlanresult it gets back the status as now completed with the FS 
task and the plan tasks



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to