aws / aws/aws-durable-execution-sdk-python

[Feature]: Deduplicate SerDes deserialization within an invocation

未关闭
#678 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement parity pkg:sdk
主要语言
Python
星标
53
派生
25
平均合并
1 天 19 小时
30 天内合并 PR
40

描述

## What would you like?

Deduplicate repeated SerDes deserialization within a single Lambda invocation.

Context-dependent SerDes implementations may perform filesystem or network I/O. Repeated access to the same checkpointed result or exception currently invokes the configured SerDes again, even when the serialized input and durable payload identity are unchanged.

## Possible Implementation

- Add an invocation-scoped deserialization cache around SDK-managed SerDes calls.
- Key entries by SerDes instance identity, durable execution ARN, operation/entity identity, payload kind when available, and a digest of the serialized input.
- Cache successful values, including `None`, but never cache failures.
- Bound completed entries with an LRU or weak-reference policy so large deserialized values are not retained indefinitely.
- If SDK-managed child/concurrency threads can request the same value concurrently, share one in-flight result rather than issuing duplicate external reads.
- Clear all entries at the end of the Lambda invocation; do not use a process-global cache across replays.
- Add tests for cache hits, distinct contexts/data, `None`, failures, eviction, and concurrent callers.

## Is this a breaking change?

No.

## Does this require an RFC?

No.

## Additional Context

This is primarily valuable for filesystem and other external-storage SerDes implementations. The Java SDK work in aws/aws-durable-execution-sdk-java#648 uses an invocation-scoped bounded cache and in-flight deduplication.

贡献指南

打开贡献指南

调研方向

首先定位由 SDK 管理的 SerDes 调用,以及可以建立和清理 invocation 作用域缓存的 Lambda invocation 生命周期。添加测试,覆盖缓存命中、不同的上下文和数据、None 值、失败、驱逐以及并发调用方;完成的标准是,重复的匹配请求会被去重,同时不会缓存失败结果,也不会跨越 invocation 边界。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
backend, cloud
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
活跃
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。