Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Retry transient errors in ActivityCompletionClient.heartbeat

未关闭
#2,984 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@dplyukhin 已经在做这个了。

开始于 2026年8月11日。

评估

这个 Issue 还没有评估数据。

描述

enhancement

Is your feature request related to a problem? Please describe.
ActivityCompletionClient.heartbeat fails on the first transient error from the server — most often RESOURCE_EXHAUSTED from namespace rate limiting, but also DEADLINE_EXCEEDED and UNAVAILABLE. For async completion, where an external process holds the task token and the heartbeat is the only thing keeping a long-running activity alive, a single rate-limited
heartbeat can cost us the activity via heartbeat timeout.

The worker-side path already handles this. HeartbeatContextImpl.doHeartBeatLocked catches StatusRuntimeException, logs a warning and reschedules after HEARTBEAT_RETRY_WAIT_MILLIS instead of failing the activity.

Describe the solution you'd like
Wrap recordHeartbeat in the same GrpcRetryer the other three reply calls in
ManualActivityCompletionClientImpl already use — complete, fail and reportCancellation
all run inside grpcRetryer.retry(...) with replyGrpcRetryerOptions, and recordHeartbeat is
the only one that doesn't. That gives heartbeat the same RESOURCE_EXHAUSTED handling
(including the message-too-large carve-out) for free.

A shorter expiration than replyGrpcRetryerOptions may make more sense here, since retrying past
the next heartbeat interval is pointless.

Open to another approach if you have one in mind — making the retryability decision public so
callers can apply their own policy would also unblock us.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

主要语言
Java
星标
434
派生
252
平均合并
6 天 5 小时
30 天内合并 PR
25

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

temporalio/sdk-java 的其他 Issue

查看 temporalio/sdk-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

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