amogh-jahagirdar commented on code in PR #14629:
URL: https://github.com/apache/iceberg/pull/14629#discussion_r2543655551


##########
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:
   Have a slight preference for trying to do the right fix for some state 
tracking around async planning but not a strong opinion, I had a bit of time, 
and I published a PR to your branch 
https://github.com/singhpk234/iceberg/pull/272 . I think it should reasonably 
cover the cases. Let me know what you think!  



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