-
Notifications
You must be signed in to change notification settings - Fork 131
fix(pb): dont immediately reallocate actors on runner stopping #3413
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: 11-07-chore_gas_rename_wake_sub_to_bump_sub
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd the label merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
PR Review: Fix actor reallocation on runner stoppingSummaryThis PR introduces a new Positive ChangesArchitecture Improvements✅ New ✅ Better state tracking: Adding ✅ Cleaner separation of concerns: The refactoring of Code Quality✅ Removed unnecessary ✅ Better logging: The debug log in ✅ Idempotency improvements: Added guards to prevent duplicate signal sends (e.g., checking Issues and Concerns1. Potential Race Condition in
|
More templates
@rivetkit/actor
@rivetkit/cloudflare-workers
@rivetkit/core
@rivetkit/db
@rivetkit/framework-base
@rivetkit/next-js
@rivetkit/react
rivetkit
@rivetkit/sql-loader
@rivetkit/engine-runner
@rivetkit/engine-runner-protocol
commit: |
79bbca9 to
87f1c1a
Compare
c0c9897 to
44cfde4
Compare
PR Review: fix(pb): dont immediately reallocate actors on runner stoppingSummaryThis PR refactors the actor lifecycle management in Pegboard to introduce a new Code Quality & Best PracticesStrengths:
Concerns:
Potential Bugs & IssuesCritical:
Medium Priority:
Minor:
Logic & Correctness
However, at
State Machine Clarity:
Performance Considerations
Security Concerns
Test CoverageMajor Concern:
Specific Code Issues
|
Code Review: Fix Pegboard Actor Immediate Reallocation on Runner StoppingOverviewThis PR addresses an issue where actors were being immediately reallocated when their runner was stopping, which is undesirable behavior. The solution introduces a new Positive Changes ✅1. Improved State Management 2. Separation of Concerns
This is conceptually sound and addresses the core issue. 3. Code Cleanup 4. Better Error Handling Concerns & Issues 🔍1. State Management Complexity
2. Idempotency Check Missing 3. Race Condition Potential if !state.going_away {
let Some(runner_workflow_id) = state.runner_workflow_id else {
return Ok(Loop::Continue);
};
// ... state modifications ...
}If 4.
5. Documentation Gaps 📝
6. Force Stop on Destroy
7. Formatting Inconsistencies 🎨
While these follow the hard tab convention, they differ from the original style. Consider consistency with the existing codebase style. 8. Test Coverage ❗
Potential Bugs 🐛1. Duplicate Stop Commands 2. Unconditional Performance Considerations ⚡
Security Concerns 🔒No security issues identified. The changes are internal to the actor lifecycle management system. Recommendations 📋
Architecture Suggestion 💡Consider modeling the actor state more explicitly: enum ActorRunState {
Allocated { runner_id: Id, runner_workflow_id: Id },
Sleeping { will_wake: bool },
Stopping { runner_id: Id, runner_workflow_id: Id },
GoingAway { runner_id: Id, runner_workflow_id: Id },
Rescheduling,
}This would make invalid states unrepresentable and clarify the state machine. VerdictThis PR addresses a real issue and the approach is sound. However, the increasing complexity of boolean state flags is concerning and aligns with the existing TODO comment. The changes work but would benefit from the refactoring mentioned in runtime.rs:20-21 to make the state machine more transparent. Recommendation: Approve with suggestions for follow-up work on state machine refactoring and test coverage. |

No description provided.