Manual completion client's recordHeartbeat swallows cancellation, reset and pause exceptions
维护者通常 1 天内回复
@dplyukhin 已经在做这个了。
开始于 2026年8月11日。
评估
这个 Issue 还没有评估数据。
描述
Expected Behavior
ManualActivityCompletionClient.recordHeartbeat should throw ActivityCanceledException,
ActivityResetException or ActivityPausedException when the server reports cancellation, reset or
pause. The method already builds those exceptions.
The declaration on the public interface should change too. recordHeartbeat is declared
throws CanceledFailure, a type the method never throws. It should name what callers really have to
handle:
// io.temporal.activity.ManualActivityCompletionClient
void recordHeartbeat(@Nullable Object details) throws ActivityCompletionException;
Actual Behavior
ActivityCanceledException, ActivityResetException and ActivityPausedException never reach the
caller. The try block wraps the response checks along with the RPC, so catch (Exception e) catches
all three. processException then turns each one into ActivityCompletionFailureException.
// ManualActivityCompletionClientImpl.java, same on main as of d310594f
try {
RecordActivityTaskHeartbeatResponse status = ActivityClientHelper.sendHeartbeatRequest(...);
if (status.getCancelRequested()) {
throw new ActivityCanceledException(); // caught below, never reaches the caller
} else if (status.getActivityReset()) {
throw new ActivityResetException(); // same
} else if (status.getActivityPaused()) {
throw new ActivityPausedException(); // same
}
...
} catch (Exception e) {
processException(e);
}
The caller now sees the same exception for a cancelled activity and for a failed heartbeat RPC. The only
way to tell them apart is to unwrap getCause().
The recordActivityTaskHeartbeatById branch has the same problem. The worker-side path does not.
HeartbeatContextImpl.sendHeartbeatRequest checks the flags outside its catch block, so
ActivityExecutionContext.heartbeat throws the specific type.
Specifications
- Version: 1.37.0
- Platform:
- 主要语言
- Java
- 星标
- 433
- 派生
- 249
- 平均合并
- 6 天 5 小时
- 30 天内合并 PR
- 25
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
temporalio/sdk-java 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
temporalio/sdk-java#2676 · 8 条评论 · 2 个 reaction ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 65/100
temporalio/sdk-java#1825 ·
维护者通常 1 天内回复
-
test server
难度 4/5 3-5 天 新手友好度 42/100
temporalio/sdk-java#3088 · 2 条评论 ·
维护者通常 1 天内回复
-
Warn if the SDK tried to send a payload above a specific size - Java可能已有人在做 @jmaeagle99 于 17 天前认领。 未关闭
temporalio/sdk-java#3059 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Allow configurable prefix for MDC keys可能已有人在做 @maciejdudko 于 17 天前认领。 未关闭enhancement
temporalio/sdk-java#3058 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 temporalio/sdk-java 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
ci-failure-cause test-failure
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 65/100
nextcloud/notes-android#3367 ·
维护者通常 1 天内回复
-
:wave: team-triage a:chore in:isolated-projects in:kotlin-dsl
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复