-
Notifications
You must be signed in to change notification settings - Fork 42
Add idle workflow tracking via internal event #261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 3fd5bae The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Pull Request Test Coverage Report for Build 20801256245Details
💛 - Coveralls |
| commands.extend(subcommands) | ||
|
|
||
| # Check for idle transition at end of processing | ||
| was_idle = _check_idle_state(init) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does init ever change? We are checking this on every tick
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's the initial state of the reducer function call, so its effectively the "last" state
logan-markewich
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense to me
Add design document outlining the approach for tracking when workflows are idle (waiting on external input) in the workflow-server. Covers detection mechanisms, state tracking, and API changes needed to support releasing idle workflows.
Refocus design on event-based approach that: - Emits WorkflowIdleEvent/WorkflowResumedEvent on transitions - Keeps events lightweight with no metadata - Avoids depending on serialized context structure - Works with different workflow backends (DBOS, Temporal, etc.)
- Only WorkflowIdleEvent needed (resumption uses existing StepStateChanged) - Idle state computed from existing BrokerState fields, not stored - No changes to context serialization required
7081baf to
3fd5bae
Compare
Add idle workflow tracking
Implements tracking for when workflows become idle (waiting on external input via
ctx.wait_for_event()).Changes
WorkflowIdleEvent: Emitted when a workflow transitions to idle state_check_idle_state()helper to determine if all steps have no pending work but have active waiters_WorkflowHandlerandPersistentHandlernow trackidle_sincetimestampidle_sinceis cleared when workflow resumes (receivesStepStateChanged(RUNNING))Definition of "Idle"
A workflow is idle when:
Future Work
This enables future implementation of: