Chasm engine to convert returned errors#9369
Merged
fretz12 merged 25 commits intotemporalio:mainfrom Mar 18, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR hardens the history service’s CHASM engine error surface by converting non-serviceerror errors (notably persistence-layer errors) into appropriate serviceerror types, while preserving internal details via logging.
Changes:
- Added a centralized
ChasmEngine.convertErrorto sanitize/translate returned errors (including persistence error mappings and a default-to-Unavailablefallback). - Routed multiple CHASM engine call paths through
convertError(e.g., StartExecution / UpdateWithStartExecution / component operations). - Added unit coverage validating error conversion behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
service/history/chasm_engine.go |
Adds and wires in error conversion logic across CHASM engine operations to prevent leaking internal/non-service errors. |
service/history/chasm_engine_test.go |
Adds unit tests intended to validate the new error conversion behavior and mappings. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
bergundy
reviewed
Mar 5, 2026
bergundy
reviewed
Mar 9, 2026
bergundy
reviewed
Mar 11, 2026
bergundy
reviewed
Mar 11, 2026
bergundy
reviewed
Mar 13, 2026
bergundy
approved these changes
Mar 18, 2026
5 tasks
stephanos
pushed a commit
that referenced
this pull request
Mar 20, 2026
## What changed? Changed chasm engine to convert errors, if needed, to the relevant service errors. Chasm errors remain as is. Internal errors (i.e., persistence) are sanitized and error details for uncategorized errors are preserved via logging. Uncategorized errors are defaulted to serviceerror.Unavailable ## Why? Currently chasm engine can expose non-service errors with internal details. We should not expose this to the API callers as those errors may eventually be exposed publicly. But we do want to preserve the original errors for debugging purposes, and thus they get logged before the conversion. ## How did you test it? - [X] built - [X] run locally and tested manually - [X] covered by existing tests - [X] added new unit test(s) - [ ] added new functional test(s)
birme
pushed a commit
to eyevinn-osaas/temporal
that referenced
this pull request
Mar 23, 2026
## What changed? Changed chasm engine to convert errors, if needed, to the relevant service errors. Chasm errors remain as is. Internal errors (i.e., persistence) are sanitized and error details for uncategorized errors are preserved via logging. Uncategorized errors are defaulted to serviceerror.Unavailable ## Why? Currently chasm engine can expose non-service errors with internal details. We should not expose this to the API callers as those errors may eventually be exposed publicly. But we do want to preserve the original errors for debugging purposes, and thus they get logged before the conversion. ## How did you test it? - [X] built - [X] run locally and tested manually - [X] covered by existing tests - [X] added new unit test(s) - [ ] added new functional test(s)
stephanos
pushed a commit
that referenced
this pull request
Mar 23, 2026
## What changed? Changed chasm engine to convert errors, if needed, to the relevant service errors. Chasm errors remain as is. Internal errors (i.e., persistence) are sanitized and error details for uncategorized errors are preserved via logging. Uncategorized errors are defaulted to serviceerror.Unavailable ## Why? Currently chasm engine can expose non-service errors with internal details. We should not expose this to the API callers as those errors may eventually be exposed publicly. But we do want to preserve the original errors for debugging purposes, and thus they get logged before the conversion. ## How did you test it? - [X] built - [X] run locally and tested manually - [X] covered by existing tests - [X] added new unit test(s) - [ ] added new functional test(s)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
Changed chasm engine to convert errors, if needed, to the relevant service errors. Chasm errors remain as is. Internal errors (i.e., persistence) are sanitized and error details for uncategorized errors are preserved via logging. Uncategorized errors are defaulted to serviceerror.Unavailable
Why?
Currently chasm engine can expose non-service errors with internal details. We should not expose this to the API callers as those errors may eventually be exposed publicly. But we do want to preserve the original errors for debugging purposes, and thus they get logged before the conversion.
How did you test it?