Skip to content

Add missing identity to Heartbeat RPC - #2265

Merged
yuandrew merged 8 commits into
temporalio:mainfrom
yuandrew:missing-heartbeat-identity
Jul 28, 2026
Merged

Add missing identity to Heartbeat RPC#2265
yuandrew merged 8 commits into
temporalio:mainfrom
yuandrew:missing-heartbeat-identity

Conversation

@yuandrew

@yuandrew yuandrew commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

What was changed

  • Send the initial worker heartbeat immediately instead of waiting one full heartbeat
    interval.
  • Leave elapsed_since_last_heartbeat unset on the first heartbeat.
  • Add test confirming RecordWorkerHeartbeatRequest.identity is sent.

Why?

Match behavior with Java and Rust

Checklist

  1. Closes

  2. How was this tested:

  1. Any docs updates needed?

Note

Low Risk
Observability and RPC field population only; no task execution or auth changes, with new unit tests covering the behavior.

Overview
Aligns Go worker heartbeat behavior with the Java and Rust SDKs.

The shared namespace heartbeat loop now fires one RecordWorkerHeartbeat as soon as it starts, instead of waiting a full interval. Worker callbacks are registered before that goroutine starts so the first batch includes the new worker.

RecordWorkerHeartbeatRequest now sets Identity from the Temporal client (ClientOptions.Identity). Each WorkerHeartbeat leaves elapsed_since_last_heartbeat unset on the first report and only populates it after a prior heartbeat timestamp exists.

Reviewed by Cursor Bugbot for commit 9352831. Bugbot is set up for automated code reviews on this repo. Configure here.

@yuandrew
yuandrew force-pushed the missing-heartbeat-identity branch from 3bc88b0 to 1397228 Compare July 13, 2026 16:12
@yuandrew
yuandrew marked this pull request as ready for review July 13, 2026 16:14
@yuandrew
yuandrew requested a review from a team as a code owner July 13, 2026 16:14

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit fd335be. Configure here.

Comment thread internal/internal_worker_heartbeat.go
@yuandrew
yuandrew enabled auto-merge (squash) July 28, 2026 14:51
@yuandrew
yuandrew merged commit fb6df4a into temporalio:main Jul 28, 2026
92 of 96 checks passed
@yuandrew
yuandrew deleted the missing-heartbeat-identity branch July 28, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants