Skip to content

fix(sdk): Align exit paths#95

Merged
1 commit merged intomainfrom
exit-paths
Oct 24, 2025
Merged

fix(sdk): Align exit paths#95
1 commit merged intomainfrom
exit-paths

Conversation

@ghost
Copy link

@ghost ghost commented Oct 23, 2025

  • Introduce ExecutionError and InvocationError for non-retriable and
    retriable errors respectfully.
  • align callback waiting behaviour according to spec:
    • terminated without resuklt will raise an error
    • terminated and successful will return appropriate value
    • anything else will suspend execution

Issue #, if available:
fixes #45

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ghost ghost force-pushed the exit-paths branch 2 times, most recently from 9ae7449 to 109aa05 Compare October 23, 2025 23:47
@ghost ghost marked this pull request as ready for review October 23, 2025 23:49
@ghost ghost requested a review from Copilot October 24, 2025 03:08
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the exception hierarchy to introduce two distinct error types: ExecutionError for non-retriable errors that return FAILED status, and InvocationError for retriable errors that trigger Lambda retries. This aligns callback waiting behavior with the specification: callbacks that terminate without a result raise an error, successful terminations return a value, and pending callbacks suspend execution.

Key changes:

  • Replaced FatalError with ExecutionError and InvocationError base classes
  • Introduced UnrecoverableError base class with TerminationReason enum
  • Updated callback result handling to align with spec for terminated vs pending operations

Reviewed Changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/aws_durable_execution_sdk_python/exceptions.py Introduces new exception hierarchy with ExecutionError, InvocationError, UnrecoverableError, and TerminationReason enum
src/aws_durable_execution_sdk_python/execution.py Updates error handling to differentiate between retriable (InvocationError) and non-retriable (ExecutionError) failures
src/aws_durable_execution_sdk_python/context.py Aligns callback result handling with spec: raises CallbackError for missing operations and suspends for pending callbacks
src/aws_durable_execution_sdk_python/operation/callback.py Replaces FatalError with CallbackError for missing callback details
src/aws_durable_execution_sdk_python/operation/child.py Updates exception handling to check for InvocationError instead of FatalError
src/aws_durable_execution_sdk_python/operation/step.py Replaces FatalError with ExecutionError for non-retriable failures
src/aws_durable_execution_sdk_python/operation/invoke.py Replaces FatalError with ExecutionError for unreachable code paths
src/aws_durable_execution_sdk_python/serdes.py Updates serialization/deserialization errors to use ExecutionError
src/aws_durable_execution_sdk_python/state.py Adds is_cancelled() method to check operation status
tests/ Updates test files to use new exception types and verify correct behavior

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ghost ghost force-pushed the exit-paths branch from 1996c35 to e878b8c Compare October 24, 2025 15:28
@ghost
Copy link
Author

ghost commented Oct 24, 2025

Last commit deals with merge conflicts ✌️

@ghost ghost force-pushed the exit-paths branch from e878b8c to 5cfec21 Compare October 24, 2025 15:44
- Introduce `ExecutionError` and `InvocationError` for non-retriable and
  retriable errors respectfully.
- align callback waiting behaviour according to spec:
  - terminated without resuklt will raise an error
  - terminated and successful will return appropriate value
  - anything else will suspend execution
@ghost ghost force-pushed the exit-paths branch from 5cfec21 to 6a8a5af Compare October 24, 2025 15:46
@ghost ghost merged commit 48015b9 into main Oct 24, 2025
8 checks passed
@wangyb-A wangyb-A deleted the exit-paths branch December 9, 2025 22:29
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Align Exit Paths and Fatal Errors with TypeScript SDK

3 participants