Skip to content

Commit a92e463

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

3 files changed

Lines changed: 23 additions & 3 deletions

File tree

openapi/openapiv2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8128,7 +8128,7 @@
81288128
},
81298129
"leaseDuration": {
81308130
"type": "string",
8131-
"description": "Duration for which the worker lease should be valid.\nServer will calculate the actual expiration time based on when it receives this request.\nIf not specified or zero, the server will use a default lease duration (typically 60 seconds)."
8131+
"description": "Duration for which the worker lease should be valid. During this time, the server considers the worker to be active.\nThe worker is expected to send periodic heartbeats to renew its lease before it expires.\n\nServer will calculate the actual expiration time based on when it receives this request.\nIf not specified or zero, the server will use a default lease duration (typically 60 seconds).\n\nThere are 3 states for a worker: Active, Inactive, and CleanedUp.\nLifecycle transitions:\n- 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.\n- 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.\n- Inactive->Active: If the server receives subsequent heartbeat from this worker, then it will transition it back to the active state.\n- Inactive->CleanedUp: If the worker remains inactive for a prolonged period, the server will cleanup the worker state. This is a terminal state.\n If the server receives subsequent heartbeat from this worker, then it will return an error."
81328132
}
81338133
}
81348134
},

openapi/openapiv3.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10359,9 +10359,19 @@ components:
1035910359
pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
1036010360
type: string
1036110361
description: |-
10362-
Duration for which the worker lease should be valid.
10362+
Duration for which the worker lease should be valid. During this time, the server considers the worker to be active.
10363+
The worker is expected to send periodic heartbeats to renew its lease before it expires.
10364+
1036310365
Server will calculate the actual expiration time based on when it receives this request.
1036410366
If not specified or zero, the server will use a default lease duration (typically 60 seconds).
10367+
10368+
There are 3 states for a worker: Active, Inactive, and CleanedUp.
10369+
Lifecycle transitions:
10370+
- 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.
10371+
- 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.
10372+
- Inactive->Active: If the server receives subsequent heartbeat from this worker, then it will transition it back to the active state.
10373+
- Inactive->CleanedUp: If the worker remains inactive for a prolonged period, the server will cleanup the worker state. This is a terminal state.
10374+
If the server receives subsequent heartbeat from this worker, then it will return an error.
1036510375
RecordWorkerHeartbeatResponse:
1036610376
type: object
1036710377
properties: {}

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)