eugenegujing opened a new issue, #9343:
URL: https://github.com/apache/texera/issues/9343

   ### What happened?
   
   `AdvanceRegionExecutionsHandler` reports a failed advance to the client only 
when the failure arrives as a failed future:
   
   ```scala
   // 
amber/src/main/scala/org/apache/texera/amber/engine/architecture/coordinator/promisehandlers/AdvanceRegionExecutionsHandler.scala:50-61
   cp.workflowExecutionManager
     .advanceRegionExecutions(cp.actorService)
     .onFailure {
       case err: WorkflowRuntimeException =>
         sendToClient(FatalError(err, err.relatedWorkerId))
       case other =>
         sendToClient(FatalError(other, None))
     }
   EmptyReturn()
   ```
   
   `WorkflowExecutionManager.advanceRegionExecutions` 
(`WorkflowExecutionManager.scala:109-122`) does part of its work before any 
future exists: line 118 maps `syncStatusAndTransitionRegionExecutionPhase()` 
over the unfinished regions eagerly. When a region enters its non-dependee 
phase, that call runs `createOutputPortStorageObjects` synchronously 
(`RegionExecutionManager.scala:348`), which throws `IllegalStateException` when 
an output port's schema cannot be resolved (`:677`) and lets any storage 
exception from `DocumentFactory.createOrReuseDocument` (`:698`) escape. Such a 
throw leaves `advanceRegionExecutions` and the handler before `.onFailure` is 
ever attached.
   
   The exception then goes through `AsyncRPCServer.invokeMethod`'s outer catch 
(`AsyncRPCServer.scala:102-105`), which logs it and returns a `ControlError` to 
the requester. The requester is the coordinator itself: 
`PortCompletedHandler.scala:88` sends the request and discards the returned 
future, so the `ControlError` only satisfies a promise nobody observes 
(`AsyncRPCClient.scala:187`).
   
   Net effect: no `FatalError` reaches the client. The computing unit log has 
an "Exception occurred" entry, the region never advances, and the UI keeps 
showing the workflow as Running until it is killed by hand.
   
   ### How to reproduce?
   
   With `AdvanceRegionExecutionsHandlerSpec`'s fixture and a 
`WorkflowExecutionManager` stub whose `advanceRegionExecutions` throws instead 
of returning a failed future, dispatching 
`CoordinatorInitiateAdvanceRegionExecutions` through `processDCM` (the real 
`AsyncRPCServer`) gives:
   
   ```text
   replies to COORDINATOR: List(ReturnInvocation(11, 
ControlError("java.lang.IllegalStateException: Failed to resolve the output 
schema", ...)))
   events sent to CLIENT:  List()
   ```
   
   Calling the handler method directly with the same stub propagates the 
exception out of `coordinatorInitiateAdvanceRegionExecutions`.
   
   End to end, the path is taken by every region after the first whenever an 
output port's schema cannot be resolved or the output port storage cannot be 
created at the time the previous region's port completes.
   
   ### Version/Branch
   
   1.4.0-incubating-SNAPSHOT (main)
   
   ### Commit Hash (Optional)
   
   _No response_
   
   ### What browsers are you seeing the problem on?
   
   _No response_
   
   ### Relevant log output
   
   ```shell
   
   ```


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

  • [I] A synchronous failure whil... eugenegujing (via GitHub) via notifications

Reply via email to