Conversation
| // Updated on terminal status. | ||
| int64 state_transition_count = 9; | ||
| // Updated once on scheduled and once on terminal status. | ||
| int64 state_size_bytes = 10; |
There was a problem hiding this comment.
This is missing on the describe result. We should either remove it here or add it there IMO, users shouldn't have to perform a list of one to get this data.
There was a problem hiding this comment.
Agree, we will write a script to verify the fields align.
There was a problem hiding this comment.
Added to ActivityExecutionInfo
| int64 state_size_bytes = 10; | ||
| // The difference between close time and scheduled time. | ||
| // This field is only populated if the activity is closed. | ||
| google.protobuf.Duration execution_duration = 11; |
There was a problem hiding this comment.
FWIW, I'd be ok if this helper field was removed since it is so easily derived (but no big deal keeping it)
There was a problem hiding this comment.
It's a system search attribute that is available for all archetypes. We have it available to query by so I think it makes sense to return it in the list response.
| // TODO: Should this be a common execution status? Seems like the other archetypes will share this status. | ||
| // (-- api-linter: core::0216::synonyms=disabled | ||
| // aip.dev/not-precedent: Named consistently with WorkflowExecutionStatus. --) | ||
| enum ActivityExecutionStatus { |
There was a problem hiding this comment.
Workflow is considering pause a status, should activity not do the same?
There was a problem hiding this comment.
The first release of standalone activity will not have a pause/unpause API.
There was a problem hiding this comment.
My understanding was there was an expectation of list working across standalone and workflow activities at some point (hopefully soon). I wonder if we should make this enum general purpose and not specific to standalone, even if standalone can't set it yet.
There was a problem hiding this comment.
We already reuse PendingActivityState in both standalone and workflow activities.
We will add the PAUSED execution status when we implement standalone activity pause.
There was a problem hiding this comment.
We will add the PAUSED execution status when we implement standalone activity pause.
Can I get confirmation that we will also add it when we implement non-standalone activity returning from list if we do that before standalone activity pause?
| // Note that it is *never* valid to have two running instances of the same activity ID. | ||
| // | ||
| // See `ActivityIdReusePolicy` for handling activity ID duplication with a *closed* activity. | ||
| enum ActivityIdConflictPolicy { |
There was a problem hiding this comment.
Do we not support TERMINATE_EXISTING? Is it something we plan to add in the future?
There was a problem hiding this comment.
Not at the moment because of some technical limitations with state based replication but theoretically it is something we should support IMHO. @dandavison can you track this?
| // A unique identifier for this start request. Typically UUIDv4. | ||
| string request_id = 3; | ||
|
|
||
| string activity_id = 4; |
There was a problem hiding this comment.
Don't need to change anything here, but can you confirm server side requires this to be set?
There was a problem hiding this comment.
Add a comment saying that this field is required and explain why it should be set and the uniqueness guarantees within the namespace?
There was a problem hiding this comment.
Done.
// Identifier for this activity. Required. This identifier should be meaningful in the user's
// own system. It must be unique among activities in the same namespace, subject to the rules
// imposed by id_reuse_policy and id_conflict_policy.
| // Incremented each time a new attempt is started. | ||
| // TODO(dandavison): Confirm if this is on scheduled or started. |
There was a problem hiding this comment.
| // Incremented each time a new attempt is started. | |
| // TODO(dandavison): Confirm if this is on scheduled or started. | |
| // Incremented each time an attempt is scheduled. |
There was a problem hiding this comment.
Agreed, just changed that.
temporal/api/common/v1/message.proto
Outdated
| string job_id = 1; | ||
| } | ||
|
|
||
| // A link to an activity. |
There was a problem hiding this comment.
This isn't supported yet, I wouldn't include it.
temporal/api/enums/v1/activity.proto
Outdated
| // Status of a standalone activity. | ||
| // The status is updated once, when the activity is originally scheduled, and again when the activity reaches a terminal | ||
| // status. | ||
| // TODO: Should this be a common execution status? Seems like the other archetypes will share this status. |
There was a problem hiding this comment.
Remove this TODO
| // TODO: Should this be a common execution status? Seems like the other archetypes will share this status. |
| // TODO: Clarify what happens if there are no more allowed retries after the current attempt. | ||
| // | ||
| // It returns success if the requested activity is already closed. | ||
| // TODO: This ^^ is copied from RequestCancelWorkflowExecution, do we want to preserve this behavior? |
There was a problem hiding this comment.
Can you please resolve these TODOs?
There was a problem hiding this comment.
TODOs removed and docstrings edited.
temporal/api/enums/v1/activity.proto
Outdated
| // Requesting to cancel an activity does not automatically transition the activity to canceled status. If the | ||
| // activity has a currently running attempt, the activity will only transition to canceled status if the current | ||
| // attempt is unsuccessful. | ||
| // TODO: Clarify what happens if there are no more allowed retries after the current attempt. |
temporal/api/enums/v1/activity.proto
Outdated
| // heartbeats. | ||
| ACTIVITY_EXECUTION_STATUS_TERMINATED = 5; | ||
| // The activity has timed out by reaching the specified shedule-to-start or schedule-to-close timeouts. | ||
| // TODO: Clarify if there are other conditions where the activity can end up in timed out status. |
1b7bf7c to
5cab57b
Compare
Missing API support for: - [ ] PauseActivity - [ ] UnpauseActivity - [ ] ResetActivity - [ ] UpdateActivityOptions
Introduce a unified method for polling / long-polling an activity execution for status and/or outcome.
Use execution-specific ID reuse & conflict policies instead of introducing shared policies for all CHASM executions.
Two APIs: 1. **Return Info, optionally waiting for next state change before doing so** In addition to Info it returns a long-poll token. Optionally accepts a long-poll token, meaning "wait for next state change and then return latest info". Optionally includes outcome and input in response. 1. **Long-poll for outcome**
NOTE the base branch is **not master**, it's standalone-activity.
**What changed?** - Removed all references to `ActivityOptions` - Add request_id to `TerminateActivityExecution` - Add `close_time` to `ActivityInfo` --------- Co-authored-by: Fred Tzeng <41805201+fretz12@users.noreply.github.com> Co-authored-by: Dan Davison <dandavison7@gmail.com>
5cab57b to
47e7e23
Compare
Final Standalone Activity API