aglinxinyuan commented on code in PR #5922:
URL: https://github.com/apache/texera/pull/5922#discussion_r3465322131
##########
amber/src/main/scala/org/apache/texera/web/service/WorkflowService.scala:
##########
@@ -277,14 +275,12 @@ class WorkflowService(
}
}
}
- // Once the execution is published via `executionService.onNext`, the
normal
- // state-store path surfaces fatal errors to the UI: `errorHandler` writes
- // them into `executionStateStore.metadataStore`, whose diff handler (set
up
- // in the WorkflowExecutionService constructor) emits a WorkflowErrorEvent
- // that `connectToExecution` forwards. Before that point, neither the
emitter
- // nor a subscriber exists yet, so a failure in the constructor itself
would
- // be recorded but never reach the frontend -- see the fallback in `catch`.
- var executionPublished = false
+ // WorkflowExecutionService construction does no external work and cannot
+ // throw; it registers its error/state diff handler up front. Once
published
+ // via `executionService.onNext`, any failure in `executeWorkflow()` is
+ // recorded by `errorHandler` into the metadata store, whose handler emits
a
+ // WorkflowErrorEvent that `connectToExecution` forwards -- a single
+ // reporting site, no separate pre-publish fallback needed.
Review Comment:
Added `WorkflowExecutionServiceSpec` (`351fed2f`) — a regression test
asserting that a fatal error recorded in the metadata store surfaces as a
`WorkflowErrorEvent` through the diff handler registered at construction (plus
a state-change → `WorkflowStateEvent` case). The construction-unused
`controllerConfig` / `resultService` are passed `null` on purpose, so a future
change that does external work during construction (which would reopen the
pre-publish gap) fails this test.
_🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
--
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]