aws / aws/aws-durable-execution-sdk-js

[Feature]: Add retryable SerDes errors and targeted retry policies

Open
#862 0 comments 0 reactions 0 assignees View on GitHub
enhancement parity pkg:sdk
Dominant language
TypeScript
Stars
84
Forks
28
Avg merge
1d 17h
Merged PRs (30d)
43

Description

## What would you like?

Add a retryable SerDes error classification and targeted retry policies for transient serialization/deserialization failures.

Currently `safeSerialize()` and `safeDeserialize()` treat any thrown error as terminal and terminate the invocation. Async SerDes implementations that use S3 Files, EFS, DynamoDB, KMS, or another external service need a way to classify transient failures and retry only that transformation.

## Possible Implementation

- Introduce a public `RetryableSerdesError` (following the repository's naming conventions) that retains the original cause.
- Add a `retrySerdes()` decorator, and make the same retry behavior available to individual stages if a composable pipeline is introduced.
- Retry only the retryable error type; all other SerDes failures should follow the existing immediate termination behavior.
- Accept a bounded retry policy with maximum attempts and optional asynchronous backoff/jitter, reusing existing retry-strategy concepts where appropriate.
- Pass the same value/data and `SerdesContext` to every attempt.
- After exhaustion, preserve the cause and terminate with the existing `SERDES_FAILED` reason.
- Ensure retries wrap only the selected SerDes transformation rather than restarting the durable operation.
- Add fake-timer tests for success after retry, exhaustion, non-retryable failures, serialize/deserialize parity, and context stability.

## Is this a breaking change?

No.

## Does this require an RFC?

No.

## Additional Context

Python already exposes `RetryableSerDesError`, while the Java SDK work in aws/aws-durable-execution-sdk-java#648 adds a targeted retry decorator for individual SerDes stages. TypeScript currently has neither a retryable SerDes classification nor a targeted retry wrapper.

Contributor guide

Open the contributing guide

Research direction

Start by locating safeSerialize(), safeDeserialize(), SerdesContext, and the existing retry-strategy concepts in the TypeScript SDK. Review how SerDes failures produce the SERDES_FAILED reason, then add fake-timer coverage for retry success, exhaustion, non-retryable failures, serialize/deserialize parity, and context stability. Done means only the selected transformation retries while other failures retain existing termination behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.