tanishqgandhi1908 opened a new pull request, #5784:
URL: https://github.com/apache/texera/pull/5784

   ### What changes were proposed in this PR?
   
   When a workflow run fails because an output port's schema can't be resolved, 
the engine threw a generic `IllegalStateException("Schema is missing")`, 
discarding the actual cause. It typically happens when a dataset used by the 
workflow has not been shared with the user running it, but nothing in the 
message says so.
   
   Root cause: in `RegionExecutionCoordinator.createOutputPortStorageObjects`, 
the output port schema is an `Either[Throwable, Schema]`, but it was unwrapped 
with `Either.getOrElse(throw new IllegalStateException("Schema is missing"))`. 
getOrElse is right-biased, so on a `Left(cause)` it evaluates the default and 
throws away the real cause.
   
   ```
   Before:  Left(cause: "no access to dataset X")  --getOrElse(throw)-->  
"Schema is missing"
   After:   Left(cause)                            -->  
IllegalStateException("Failed to resolve the output schema: " + cause.msg, 
cause)
   ```
   
   The fix matches on the `Either` and, on `Left`, throws an 
`IllegalStateException` that keeps the original cause as the exception cause 
   
   **Before / After** (the message surfaces in the workspace Result Panel → 
Static Error frame):
   
   | | Message |
   |---|---|
   | **Before** | Schema is missing |
   | **After** | Failed to resolve the output schema: <real cause> (e.g. …: 
User has no access to this dataset) |
   
   ### Any related issues, documentation, discussions?
   
   Closes #3546
   
   ### How was this PR tested?
   
   Added a regression test in `RegionExecutionCoordinatorSpec` that seeds an 
output port with a Left(cause) schema and asserts the coordinator throws an 
IllegalStateException whose getCause is the original cause and whose message 
contains the underlying message. The existing positive-path tests in the same 
spec continue to pass.
   
   ```
   sbt "WorkflowExecutionService/testOnly 
org.apache.texera.amber.engine.architecture.scheduling.RegionExecutionCoordinatorSpec"
   ...
   [info] Total number of tests run: 3
   [info] Tests: succeeded 3, failed 0, canceled 0, ignored 0, pending 0
   [info] All tests passed.
   ```
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Claude Opus 4.8)


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