Skip to content

Commit dffd5b8

Browse files
committed
Add more comments
1 parent 8db1c11 commit dffd5b8

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

temporal/api/workflowservice/v1/request_response.proto

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2468,9 +2468,19 @@ message RecordWorkerHeartbeatRequest {
24682468

24692469
repeated temporal.api.worker.v1.WorkerHeartbeat worker_heartbeat = 3;
24702470

2471-
// Duration for which the worker lease should be valid.
2471+
// Duration for which the worker lease should be valid. During this time, the server considers the worker to be active.
2472+
// The worker is expected to send periodic heartbeats to renew its lease before it expires.
2473+
//
24722474
// Server will calculate the actual expiration time based on when it receives this request.
24732475
// If not specified or zero, the server will use a default lease duration (typically 60 seconds).
2476+
//
2477+
// There are 3 states for a worker: Active, Inactive, and CleanedUp.
2478+
// Lifecycle transitions:
2479+
// - Active->Active: Each time the server receives a heartbeat from the worker, it will renew the lease and keep the worker in the active state.
2480+
// - Active->Inactive: When the lease expires, the server will consider the worker to be inactive, and reschedule activities that were known to be running as of that time.
2481+
// - Inactive->Active: If the server receives subsequent heartbeat from this worker, then it will transition it back to the active state.
2482+
// - Inactive->CleanedUp: If the worker remains inactive for a prolonged period, the server will cleanup the worker state. This is a terminal state.
2483+
// If the server receives subsequent heartbeat from this worker, then it will return an error.
24742484
google.protobuf.Duration lease_duration = 4;
24752485
}
24762486

0 commit comments

Comments
 (0)