Skip to content

Commit e2edc18

Browse files
authored
Add more state to the pending activity state (#565)
_**READ BEFORE MERGING:** All PRs require approval by both Server AND SDK teams before merging! This is why the number of required approvals is "2" and not "1"--two reviewers from the same team is NOT sufficient. If your PR is not approved by someone in BOTH teams, it may be summarily reverted._ <!-- Describe what has changed in this PR --> **What changed?** Add PAUSED/PAUSE_REQUESTED states to the PendictActivityState enum. <!-- Tell your future self why have you made these changes --> **Why?** To easily differentiate between "activity is paused on server and still running on worker" and "activity is paused on server and not running on worker". This is the result of our discussion for activity commands. In old terms: "state == PAUSED" is "state = SCHEDULLED and paused_flag = true" "state == PAUSE_REQUESTED" is "state = STARTED and paused_flag = true"
1 parent 4ad8563 commit e2edc18

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

Diff for: openapi/openapiv2.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -11608,9 +11608,12 @@
1160811608
"PENDING_ACTIVITY_STATE_UNSPECIFIED",
1160911609
"PENDING_ACTIVITY_STATE_SCHEDULED",
1161011610
"PENDING_ACTIVITY_STATE_STARTED",
11611-
"PENDING_ACTIVITY_STATE_CANCEL_REQUESTED"
11611+
"PENDING_ACTIVITY_STATE_CANCEL_REQUESTED",
11612+
"PENDING_ACTIVITY_STATE_PAUSED",
11613+
"PENDING_ACTIVITY_STATE_PAUSE_REQUESTED"
1161211614
],
11613-
"default": "PENDING_ACTIVITY_STATE_UNSPECIFIED"
11615+
"default": "PENDING_ACTIVITY_STATE_UNSPECIFIED",
11616+
"title": "- PENDING_ACTIVITY_STATE_PAUSED: PAUSED means activity is paused on the server, and is not running in the worker\n - PENDING_ACTIVITY_STATE_PAUSE_REQUESTED: PAUSE_REQUESTED means activity is currently running on the worker, but paused on the server"
1161411617
},
1161511618
"v1PendingChildExecutionInfo": {
1161611619
"type": "object",

Diff for: openapi/openapiv3.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -8715,6 +8715,8 @@ components:
87158715
- PENDING_ACTIVITY_STATE_SCHEDULED
87168716
- PENDING_ACTIVITY_STATE_STARTED
87178717
- PENDING_ACTIVITY_STATE_CANCEL_REQUESTED
8718+
- PENDING_ACTIVITY_STATE_PAUSED
8719+
- PENDING_ACTIVITY_STATE_PAUSE_REQUESTED
87188720
type: string
87198721
format: enum
87208722
heartbeatDetails:

Diff for: temporal/api/enums/v1/workflow.proto

+4
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ enum PendingActivityState {
106106
PENDING_ACTIVITY_STATE_SCHEDULED = 1;
107107
PENDING_ACTIVITY_STATE_STARTED = 2;
108108
PENDING_ACTIVITY_STATE_CANCEL_REQUESTED = 3;
109+
// PAUSED means activity is paused on the server, and is not running in the worker
110+
PENDING_ACTIVITY_STATE_PAUSED = 4;
111+
// PAUSE_REQUESTED means activity is currently running on the worker, but paused on the server
112+
PENDING_ACTIVITY_STATE_PAUSE_REQUESTED = 5;
109113
}
110114

111115
enum PendingWorkflowTaskState {

0 commit comments

Comments
 (0)