[Bug]: waitForCondition exhaustion can produce FAILED invocation without ErrorObject
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
先从 WaitForConditionOperation.handleCheckFailure()、ChildContextOperation.handleChildContextFailure() 和 DurableExecutor.buildErrorObject() 入手,然后使用 LocalDurableTestRunner 运行 runInChildContext 的同步复现。添加 null-error 回退,并添加一个覆盖最大尝试次数耗尽的集成测试。当 step、child context 和 root invocation 全部为 FAILED 且包含错误详情时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Expected Behavior
When waitForCondition exhausts its configured attempts, the SDK should:
- Checkpoint the
WaitForConditionstep asFAILEDwith a non-nullErrorObject. - Checkpoint an enclosing synchronous child context as
FAILEDwith a non-nullErrorObject. - Return a root
DurableExecutionInvocationOutputwithStatus=FAILEDand a non-nullErrorObject.
This ensures replay preserves useful diagnostics and any service/emulator consuming the invocation result can reliably record the execution as failed.
Actual Behavior
The built-in wait strategies throw WaitForConditionFailedException(String), whose DurableOperationException state has a null ErrorObject.
That null propagates through the failure path:
WaitForConditionOperation.handleCheckFailure()reusesDurableOperationException.getErrorObject()without a null fallback.ChildContextOperation.handleChildContextFailure()does the same.DurableExecutor.buildErrorObject()returnsDurableOperationException.getErrorObject()directly, even when it is null.
The final invocation output can therefore be equivalent to:
{
"Status": "FAILED"
}
The Java LocalDurableTestRunner preserves the FAILED status, but the error is absent. When used through SAM Local, this combines with an emulator bug that currently converts FAILED with no error into ExecutionSucceeded.
Steps to Reproduce
Use a synchronous child context containing a condition that never stops polling:
var runner = LocalDurableTestRunner.create(String.class, (input, ctx) ->
ctx.runInChildContext("child", String.class, child ->
child.waitForCondition(
"poll",
String.class,
(state, stepCtx) -> WaitForConditionResult.continuePolling(state),
WaitForConditionConfig.<String>builder()
.waitStrategy(WaitStrategies.fixedDelay(
2, Duration.ofSeconds(1)))
.build())));
var result = runner.runUntilComplete("test");
The local runner reports FAILED, but the root error is absent. Running the equivalent handler through SAM Local can produce this history:
StepFailed (WaitForCondition)
ContextFailed (RunInChildContext)
InvocationCompleted
ExecutionSucceeded
SDK Version
2.1.0; the behavior is also present on current 2.1.1-SNAPSHOT / main as of 2026-08-19.
Java Version
17
Is this a regression?
No known working version.
Last Working Version
N/A
Proposed Fix
Always fall back to serializing the thrown exception when an SDK exception has no embedded error:
if (e instanceof DurableOperationException operationException
&& operationException.getErrorObject() != null) {
return operationException.getErrorObject();
}
return ExceptionHelper.buildErrorObject(e, serDes);
Apply equivalent null fallbacks when checkpointing failures in WaitForConditionOperation and ChildContextOperation, so operation history and replay also retain the error.
Add an integration test for max-attempt exhaustion inside synchronous runInChildContext that asserts:
- the step is failed with error details;
- the child context is failed with error details;
- the root invocation is
FAILEDwith an error.
Related Issue
The SAM Local emulator status-handling defect exposed by this null error is tracked in aws/aws-durable-execution-sdk-python#656.
- 主要语言
- Java
- 星标
- 28
- 派生
- 13
- 平均合并
- 2 天 3 小时
- 30 天内合并 PR
- 44
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
aws/aws-durable-execution-sdk-java 的其他 Issue
-
documentation pkg:sdk
难度 1/5 1-3 小时 新手友好度 88/100
aws/aws-durable-execution-sdk-java#645 · 1 条评论 ·
维护者通常 1 天内回复
-
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 天内回复
-
[Bug]: root handler instrumentation misses the canonical OTel execution context可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭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 天内回复
查看 aws/aws-durable-execution-sdk-java 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 86/100
-
Make branch and label autocomplete matching locale-independent可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 83/100
jenkinsci/gitlab-plugin#1950 ·
-
It's not necessary to copy the memory block in the readWrite() of org.h2.store.fs.mem.FileMemData未关闭
难度 2/5 1-3 小时 新手友好度 78/100
h2database/h2database#4435 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
micronaut-projects/micronaut-core#13717 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
ADORSYS-GIS/token-status-link#145 ·
维护者通常 3 天内回复