Skip to content

fix(sdk):Parity on checkpoint errors#135

Merged
2 commits merged intomainfrom
checkpoint-parity
Nov 8, 2025
Merged

fix(sdk):Parity on checkpoint errors#135
2 commits merged intomainfrom
checkpoint-parity

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Nov 8, 2025

Changes:

  • CheckpointErrors now inspect service metadata and identify whether
    they should be invocation errors or execution errors
  • Added tests to ensure we match reference
  • Added tests to ensure we test all in execution.py

Issue #, if available:

Description of changes:

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

Changes:
 - CheckpointErrors now inspect service metadata and identify whether
   they should be invocation errors or execution errors
 - Added tests to ensure we match reference
 - Added tests to ensure we test all in execution.py
@ghost ghost requested review from wangyb-A and yaythomas as code owners November 8, 2025 01:04
isinstance(bg_error.source_exception, CheckpointError)
and bg_error.source_exception.should_be_retried()
):
raise bg_error.source_exception from None # Terminate Lambda immediately and have it be retried
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

We use from None to indicate that the error didn't originate from handling the exception in the first place, but instead is a continuation.

Comment on lines +349 to +350
if e.should_be_retried():
raise # Terminate Lambda immediately and have it be retried
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Here we don't do from since this is an unwrapped CheckpointError.

@ghost ghost changed the title fix(sdk): Differentiate Invocation and Execution Checkpoint errors fix(sdk):Differentiate Invocation and Execution Checkpoint errors Nov 8, 2025
@ghost ghost closed this Nov 8, 2025
@ghost ghost reopened this Nov 8, 2025
@ghost ghost changed the title fix(sdk):Differentiate Invocation and Execution Checkpoint errors fix(sdk):Parity on checkpoint errors Nov 8, 2025
@ghost ghost closed this Nov 8, 2025
@ghost ghost reopened this Nov 8, 2025
self.step_id = step_id


CheckpointErrorKind = Literal["Execution", "Invocation"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why not enum?

error_kind = "Execution"
return CheckpointError(str(exception), error_kind, error, metadata)

def should_be_retried(self):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is_retriable

def __init__(
self,
message: str,
error_kind: CheckpointErrorKind,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

.category = ErrorCategory.INVOCATION

@ghost ghost force-pushed the checkpoint-parity branch from 1c513c0 to 1df00f2 Compare November 8, 2025 14:09
@ghost ghost requested a review from yaythomas November 8, 2025 20:12
@ghost ghost merged commit 9f55997 into main Nov 8, 2025
9 checks passed
@ghost ghost deleted the checkpoint-parity branch November 8, 2025 20:20
@ghost ghost mentioned this pull request Nov 8, 2025
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.

2 participants