Repository navigation
Conversation
0777f80 to
68d5430
Compare
| // `ActivityOptions.schedule_to_close_timeout` bounds. Positive heartbeat timeouts are capped by | ||
| // their phase timeout and those positive bounds. The server stores and returns normalized values. | ||
| // Increasing a bound does not restore a capped value unless that value is also updated. | ||
| message AsyncHandoffOptions { |
There was a problem hiding this comment.
I don't think the word "async" helps users or adds anything. I'm thinking this should just be "HandoffOptions".
| google.protobuf.Duration start_delay = 8; | ||
|
|
||
| // Two-phase timeout and retry settings. | ||
| AsyncHandoffOptions async_handoff_options = 9; |
There was a problem hiding this comment.
As above, I suggest
| AsyncHandoffOptions async_handoff_options = 9; | |
| HandoffOptions handoff_options = 9; |
| // aip.dev/not-precedent: "to" is used to indicate interval. --) | ||
| google.protobuf.Duration schedule_to_close_timeout = 14; | ||
| // Current attempt start -> final result reported timeout | ||
| // Configured start-to-close timeout for the activity attempt. |
There was a problem hiding this comment.
I believe that SDKs set a local timer based on the returned start_to_close_timeout, so I'm not sure we can change its semantics. If the new PR returns zero here then I think SDKs might start an activity and immediately expire its context unless they all change to handle the new timeouts.
There was a problem hiding this comment.
Yes, this requires SDK deadline handling changes. Without handoff options, existing timeout normalization remains unchanged, so we're safe to release this API first while the server feature flag remains disabled. Activities with handoff options set will require a supporting worker SDK that treats zero as disabled. I’ve clarified the behavior in the comment.
| // PAUSE_REQUESTED means activity is currently running on the worker, but paused on the server | ||
| PENDING_ACTIVITY_STATE_PAUSE_REQUESTED = 5; | ||
| // The server has recorded async handoff and is waiting for external completion. | ||
| PENDING_ACTIVITY_STATE_AWAITING_COMPLETION = 6; |
There was a problem hiding this comment.
I’d like to propose that the state name returned by the API is HANDED_OFF. The term “handoff” is used throughout the API (AsyncHandoffOptions, start_to_handoff_timeout, handoff_to_close_timeout, async_handoff_time, handoff_attempt) so it would be consistent to use "handoff" in the state that Describe returns. AWAITING_COMPLETION doesn’t work as well because any activity attempt that’s in progress can be said to be awaiting completion. Sorry I didn’t raise this before now.
There was a problem hiding this comment.
ok, seems more consistent
f831c3a to
9c9a951
Compare
| google.protobuf.Timestamp async_handoff_time = 27; | ||
|
|
||
| // True while waiting for external completion. Pending pause, cancel, or reset requests do not clear it. | ||
| bool awaiting_completion = 28; |
There was a problem hiding this comment.
I think this one got missed:
| bool awaiting_completion = 28; | |
| bool handed_off = 28; |
| int32 handoff_attempt = 26; | ||
|
|
||
| // Most recent durably accepted handoff time. Cleared at the next worker pickup or applied reset. | ||
| google.protobuf.Timestamp async_handoff_time = 27; |
There was a problem hiding this comment.
| google.protobuf.Timestamp async_handoff_time = 27; | |
| google.protobuf.Timestamp handoff_time = 27; |
| // True while the current delivery awaits external completion, independent of | ||
| // `ActivityExecutionInfo.run_state`. Cleared when the delivery ends or is reset; | ||
| // pending pause, cancel, or reset requests do not clear it. | ||
| bool awaiting_completion = 46; |
There was a problem hiding this comment.
| bool awaiting_completion = 46; | |
| bool handed_off = 46; |
| // Most recent durably recorded handoff time. Retained through retry backoff, waiting for the | ||
| // next worker pickup, and terminal closure. Cleared when a reset is applied or the next delivery | ||
| // starts on a worker. | ||
| google.protobuf.Timestamp async_handoff_time = 45; |
There was a problem hiding this comment.
| google.protobuf.Timestamp async_handoff_time = 45; | |
| google.protobuf.Timestamp handoff_time = 45; |
What changed?
Added async handoff API definitions for workflow and standalone activities: RespondActivityTaskHandoff, AsyncHandoffOptions, handoff counters and state, timeout types, and namespace capabilities. Added handoff options to workflow scheduling commands and scheduled history events.
Why?
Allow activities to report handoff for external completion, with separate timeout and retry controls before and after handoff. Defines a shared contract for server and SDK implementations while preserving existing behavior when handoff options are absent.