-
Notifications
You must be signed in to change notification settings - Fork 134
fix(gas): fix batch listen, fix history for graceful signal send in workflows #3479
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-17-feat_gas_add_batch_listen
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
PR Review: Fix batch listen, fix history for graceful signal send in workflowsSummaryThis PR introduces two main improvements to the gasoline workflow engine:
Code Quality & Best PracticesStrengths:
Suggestions:
Potential Bugs & IssuesCritical:
Minor:
Performance ConsiderationsImprovements:
Concerns:
Security ConcernsNo security issues identified. The changes:
Test CoverageMissing test scenarios:
Recommended test additions: // Test graceful signal send with replay
#[test]
async fn test_graceful_signal_not_found_replay() {
// First run: target doesn't exist, should create removed event
// Second run: should replay removed event correctly
}
// Test batch signal ordering
#[test]
async fn test_batch_signal_timestamp_ordering() {
// Create signals with out-of-order timestamps
// Verify they're received in timestamp order
}Additional Notes
VerdictLGTM with minor suggestions This is a solid improvement to the workflow engine. The graceful signal sending feature is well-implemented with proper history tracking for replay consistency. The batch listen fixes address real bugs in signal ordering and indexed chunk handling. The loop optimization should provide measurable performance improvements. The code follows project conventions, has good documentation, and maintains backward compatibility. Recommended to merge after addressing the test coverage gaps. Recommendation: Approve with suggestion to add tests before merge. |
More templates
@rivetkit/cloudflare-workers
@rivetkit/db
@rivetkit/framework-base
@rivetkit/next-js
@rivetkit/react
rivetkit
@rivetkit/sql-loader
@rivetkit/engine-runner
@rivetkit/engine-runner-protocol
commit: |
25ece3d to
6ff29f6
Compare
0ca2fa2 to
321b2c3
Compare
|
Critical Issues - Must Fix Before Merge
Affected locations:
Example of what needs fixing - change from this pattern: To this pattern:
Positive Changes:
Recommendations:
The core concept is solid - adding graceful degradation for missing signal targets is the right approach. However, compilation errors need fixing before merge. |
Code Review: Batch Listen & Graceful Signal SendThis PR introduces important improvements to the workflow signal system, but there are several critical issues that need to be addressed before merging. Critical Issue: Missing runner2 ModuleSeverity: Critical - Breaks Compilation Multiple files reference workflows::runner2 but the module does not exist:
However, engine/packages/pegboard/src/workflows/mod.rs only declares pub mod actor and pub mod runner. Fix Required: Either add pub mod runner2 and create the module file, OR revert all references back to runner if runner2 was intended for a different PR. |
Code Quality Issues1. Potential Logic Issue in Batch Listen Sort/LimitSeverity: Medium In engine/packages/gasoline/src/db/kv/mod.rs:1945-2067, the limit is applied twice:
If there are multiple signal types in the filter, this could fetch more signals than needed. For example, with 3 signal types and limit=10, you might fetch up to 30 signals, then sort and take 10. Recommendation: Consider using limit: None in the initial fetch, or adjust the per-type limit to account for multiple signal types. 2. Inconsistent Event Type NamingSeverity: Low The signal batch receive event is called different things across the codebase:
Consider standardizing terminology. |
Good Practices Observed1. Excellent Error Handling PatternThe graceful_not_found() API is well-designed and much cleaner than the previous pattern of checking for specific error types. This is a clean builder API that improves code readability significantly! 2. Proper History Tracking for Graceful Not FoundThe implementation correctly handles replay scenarios by:
This maintains workflow determinism properly. 3. Loop Optimization ParallelizationThe loop optimization in engine/packages/gasoline/src/ctx/workflow.rs:866-979 is well-documented with detailed comments explaining the parallelization strategy, which is excellent for maintainability. |
Test CoverageMissing Tests for New FeaturesSeverity: Medium The PR adds significant new functionality but I do not see corresponding tests:
Recommendation: Add integration tests in engine/packages/gasoline/tests/workflows/ following the pattern of signal_test.rs. |
SummaryMust Fix Before Merge:
Should Fix: Nice to Have: Overall, this is a solid improvement to the signal system with good attention to replay consistency and error handling. The main blocker is the runner2 compilation issue. Once that is resolved and tests are added, this should be ready to merge. Great work on the graceful error handling pattern! |

No description provided.