time skipping supports max skip, polling, describe#835
Conversation
| google.protobuf.Timestamp fast_forward_target_time = 2; | ||
|
|
||
| // The initial skip count. It only propagates across a chain of runs within the same execution. | ||
| int32 initial_skip_count = 3; |
There was a problem hiding this comment.
for reviewers: this shall be propagated so that we can stop workflow retry as workflow retry generates a new run instead retrying within the same run
085a333 to
67f341b
Compare
| // | ||
| // If this field is not set, the server applies a large default value (e.g. 100). The default can | ||
| // be changed through dynamic config, and is overridden by this field when set. | ||
| int32 max_skip_per_session = 4; |
There was a problem hiding this comment.
we use a per_session max_skip instead of a total/delta max_skip to make this feature easy
the unneeded complexity introduced by other options:
- total: when the value is updated, both the client and server need to read current skip number to decide if the new value is valid and we may need to expose the current skip number
- delta: as we set a default value when the field is not set, if the user set TSC multiple times, delta may silently accumulate the total number to a large number
| // The fast-forward that was active when the poll started reached its target time and completed. | ||
| RESULT_FAST_FORWARD_COMPLETED = 2; | ||
| // No fast-forward was in progress when the poll started, so there was nothing to wait for. | ||
| RESULT_NO_PENDING_FAST_FORWARD = 3; |
There was a problem hiding this comment.
also need to add an result of workflow end (status = completed/failed/canceled/TERMINATED/TIMED_OUT)
but we need the whole execution (a chain of runs) to end instead of a single run's status
|
|
||
| message PollWorkflowExecutionTimeSkippingResponse { | ||
| enum Result { | ||
| // The poll timed out server-side before any time-skipping state change occurred to fast forward. |
There was a problem hiding this comment.
Sound like this should be different than RESULT_UNSPECIFIED, maybe RESULT_TIMED_OUT?
| // In-flight work includes activities, child workflows, Nexus operations, signal/cancel external workflow operations, etc. | ||
| // User timers are not classified as in-flight work and will be skipped over; the virtual clock may also skip to the | ||
| // time point of the registered fast-forward when there is no in-flight work. | ||
| // Every time time is skipped, the skip count is incremented by one; max_skip_per_session bounds the number of skips allowed within a single time-skipping session. |
9c9afa6 to
d1ea493
Compare
2a371d8 to
dd493a2
Compare
| google.protobuf.Duration fast_forward = 2; | ||
|
|
||
| // A client-supplied ID that must be set together with `fast_forward`. It is used to poll for | ||
| // fast-forward completion via PollWorkflowExecutionTimeSkipping. |
There was a problem hiding this comment.
for reviewers: explicitly making this id required if fast_forward is used for simplicity
dd493a2 to
b4113e7
Compare
| // If this field is not set, the server applies a large default value (e.g. 100). The default can | ||
| // be changed through dynamic config, and is overridden by this field when set. | ||
| int32 max_skip_per_session = 4; | ||
| } |
There was a problem hiding this comment.
other similar name: "session_max_skip"
| // If the execution is actively trying to skip time automatically when there is a chance, | ||
| // this field will be set to true. If time has stopped skipping either by fast-forward completion, | ||
| // max skip allowed checking, or user configuration, it will be false. | ||
| bool is_running = 2; |
There was a problem hiding this comment.
b4113e7 to
4d4a582
Compare
What changed?
TimeSkippingConfigTimeSkippingInfotoDescribeWorkflowExecution(contains virtual current time and running status)PollWorkflowExecutionTimeSkippingfor fast-forward completion