[Docs]: Document finally cleanup behavior during durable suspension
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 1/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 88/100
- Issue 类型
- 文档
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- java
调研方向
从 docs/advanced/error-handling.md 中的“Handling SuspendExecutionException”部分开始,并查看链接的共享文档请求以了解上下文。记录 finally 在暂停期间的行为,说明安全放置清理操作的位置以及异常传播方式,并包含提议的 Java 示例;当该部分同时涵盖正常暂停和终止清理路径时,即可完成。
由索引模型根据 Issue 内容生成。
描述
Issue
The Handling SuspendExecutionException section correctly explains that SuspendExecutionException extends Error, bypasses a normal catch (Exception e), and must never be swallowed.
It does not currently explain the related finally behavior: Java executes an active finally block while SuspendExecutionException unwinds the stack. As a result, resource cleanup placed in finally can run during a normal durable suspension rather than only when the overall durable execution succeeds or fails.
This applies to any operation that can suspend, including wait, waitForCondition, callbacks, invokes, retry delays, and suspension inside map or parallel branches.
For example, this pattern can terminate a resource immediately when the wait suspends:
try {
var resource = ctx.step("launch-resource", Resource.class,
stepCtx -> launchResource());
var result = ctx.waitForCallback("work-complete", Result.class,
(callbackId, stepCtx) -> dispatchWork(resource, callbackId));
return result;
} finally {
ctx.step("terminate-resource", Void.class,
stepCtx -> terminateResource());
}
Page/Location
https://github.com/aws/aws-durable-execution-sdk-java/blob/main/docs/advanced/error-handling.md
Section: Handling SuspendExecutionException
Suggested Fix
Extend the section with guidance that:
finallyexecutes when the internal suspension signal unwinds the handler stack.- Durable cleanup that must happen only on completion or actual failure should not be placed in
finallyaround suspending operations. - Cleanup should run explicitly after successful completion and from handlers for application or operation exceptions.
SuspendExecutionExceptionmust continue to propagate untouched; avoidcatch (Throwable)unless it immediately rethrows suspension and other control-flow errors appropriately.
Include a safe Java example such as:
try {
var result = performDurableWorkThatMaySuspend(ctx);
ctx.step("cleanup-resource", Void.class,
stepCtx -> cleanupResource());
return result;
} catch (Exception e) {
ctx.step("cleanup-resource", Void.class,
stepCtx -> cleanupResource());
throw e;
}
The cleanup step occupies the same next durable-operation position on either terminal path, while SuspendExecutionException bypasses catch (Exception e) and suspends normally.
This is the Java-specific companion to the shared documentation request: https://github.com/aws/aws-durable-execution-docs/issues/131.
- 主要语言
- Java
- 星标
- 28
- 派生
- 14
- 平均合并
- 2 天 19 小时
- 30 天内合并 PR
- 43
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
aws/aws-durable-execution-sdk-java 的其他 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 68/100
aws/aws-durable-execution-sdk-java#300 ·
维护者通常 1 天内回复
-
enhancement needs-triage
难度 5/5 一周以上 新手友好度 35/100
aws/aws-durable-execution-sdk-java#779 ·
维护者通常 1 天内回复
-
needs-triage
难度 5/5 一周以上 新手友好度 40/100
aws/aws-durable-execution-sdk-java#770 ·
维护者通常 1 天内回复
-
[Feature]: Propagate per-operation trace context for chained invokes可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭enhancement needs-triage
难度 5/5 一周以上 新手友好度 38/100
aws/aws-durable-execution-sdk-java#764 ·
维护者通常 1 天内回复
-
[Bug]: OTel ignores the invocation-local X-Ray header on Lambda Managed Instances可能已有人在做 @zhongkechen 于 5 天前认领。 未关闭bug needs-triage
难度 5/5 一周以上 新手友好度 38/100
aws/aws-durable-execution-sdk-java#762 ·
维护者通常 1 天内回复
查看 aws/aws-durable-execution-sdk-java 的全部 Issue
相似的 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
waiting-for-triage
难度 1/5 1 小时以内 新手友好度 72/100
spring-cloud/spring-cloud-openfeign#1443 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 84/100
ADORSYS-GIS/keycloak-oid4vp-plugin#221 ·
维护者通常 2 天内回复
-
status: team-only type: dependency-upgrade
难度 2/5 1-3 小时 新手友好度 65/100
spring-projects/spring-boot#52099 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
tchiotludo/akhq#3307 · 1 个 reaction ·
维护者通常 1 天内回复