Skip to content

time skipping supports max skip, polling, describe#835

Draft
feiyang3cat wants to merge 6 commits into
mainfrom
vts-maxskip-poll
Draft

time skipping supports max skip, polling, describe#835
feiyang3cat wants to merge 6 commits into
mainfrom
vts-maxskip-poll

Conversation

@feiyang3cat

@feiyang3cat feiyang3cat commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

What changed?

  1. add a max skip field to TimeSkippingConfig
  2. add TimeSkippingInfo to DescribeWorkflowExecution (contains virtual current time and running status)
  3. add PollWorkflowExecutionTimeSkipping for fast-forward completion
  4. comment refinements: remove the workflow keyword from time-skipping message comments under the common path

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;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@feiyang3cat feiyang3cat changed the title add max_skip_count and change comments of TimeSkippingConfig time skipping supports max skip, polling, describe Jul 20, 2026
//
// 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;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. 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
  2. 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;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

time time :)

@feiyang3cat
feiyang3cat force-pushed the vts-maxskip-poll branch 3 times, most recently from 9c9afa6 to d1ea493 Compare July 21, 2026 00:33
@feiyang3cat
feiyang3cat force-pushed the vts-maxskip-poll branch 2 times, most recently from 2a371d8 to dd493a2 Compare July 21, 2026 00:41
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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for reviewers: explicitly making this id required if fast_forward is used for simplicity

// 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;
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants