aglinxinyuan commented on code in PR #4206:
URL: https://github.com/apache/texera/pull/4206#discussion_r3290956738


##########
amber/src/main/scala/org/apache/texera/web/service/WorkflowExecutionService.scala:
##########
@@ -66,7 +67,12 @@ class WorkflowExecutionService(
 ) extends SubscriptionManager
     with LazyLogging {
 
-  workflowContext.workflowSettings = request.workflowSettings
+  workflowContext.workflowSettings =
+    if (request.logicalPlan.operators.exists(_.isInstanceOf[LoopStartOpDesc])) 
{
+      request.workflowSettings.copy(executionMode = ExecutionMode.MATERIALIZED)
+    } else {
+      request.workflowSettings

Review Comment:
   Good catch — fixed in a79fc395b8.
   
   The silent coercion is gone. WorkflowExecutionService now throws an 
`IllegalArgumentException` with an actionable message:
   
   > This workflow contains loop operators (Loop Start / Loop End), which 
require the execution mode to be MATERIALIZED. Please open Workflow Settings → 
Execution Mode, change it to Materialized, and re-run.
   
   `WorkflowService` wraps the constructor in `try { ... } catch { case e: 
Throwable => errorHandler(e) }` 
([WorkflowService.scala:273-289](https://github.com/apache/texera/blob/main/amber/src/main/scala/org/apache/texera/web/service/WorkflowService.scala#L273-L289)),
 and `errorHandler` writes the exception into the `ExecutionStateStore` as a 
fatal `WorkflowFatalError` of type `EXECUTION_FAILURE` — which the existing 
diff handler on line 87 already converts to a `WorkflowErrorEvent` for the 
frontend. So the user sees the message directly in the UI; no more divergence 
between the displayed setting and the engine.



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