-
Notifications
You must be signed in to change notification settings - Fork 135
fix(runtime): evict runners on SIGTERM, add periodic shutdown progress messages #3550
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-24-fix_pb_implement_events_and_commands_for_actor_wfs
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 4 Skipped Deployments
|
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: |
Code ReviewThank you for this PR! This adds important shutdown observability and graceful termination handling. Here is my feedback: Strengths
Issues and Suggestions1. Missing SIGTERM handling in tunnel_to_ws_task.rsThe ws_to_tunnel_task.rs now handles SIGTERM and sends the GoingAway error, but tunnel_to_ws_task.rs does not have the same logic. This creates an asymmetry in how the two directions handle graceful shutdown. Suggestion: Add the same SIGTERM handling to tunnel_to_ws_task.rs for consistency. The runner should evict gracefully from both directions. 2. Missing newline in JSON error fileThe file engine/artifacts/errors/ws.going_away.json is missing a trailing newline, which violates common conventions and may cause issues with some tools. Suggestion: Add a newline at the end of the JSON file. 3. Memory ordering is correctYou are using Ordering::Release for the store and Ordering::Acquire for the load on hyper_shutdown. This is correct for ensuring visibility of the write to readers. Good job! 4. Consider extracting the shutdown interval constantBoth gasoline/worker.rs and guard-core/server.rs define SHUTDOWN_PROGRESS_INTERVAL as Duration::from_secs(7). Suggestion: If you expect this to be consistent across services, consider extracting it to a shared configuration or runtime module. Test CoverageI did not see any tests added for the new shutdown progress logging, the GoingAway error path in websocket handling, or the remaining_tasks method. Suggestion: Consider adding integration tests that verify SIGTERM triggers graceful shutdown with progress messages and WebSocket connections receive the proper GoingAway close code. Minor Observations
Priority Fixes
Overall, this is a solid improvement to shutdown observability! The main concern is the missing SIGTERM handling in the tunnel-to-ws direction. Review generated with Claude Code |
5d5591a to
ef06c0e
Compare
PR Review: fix(runtime): evict runners on SIGTERM, add periodic shutdown progress messagesSummaryThis PR improves graceful shutdown behavior across the runtime by:
Code Quality & Best PracticesPositive:
Concerns:
Potential Bugs
Performance Considerations
Security ConcernsNone identified. The changes are focused on shutdown behavior and observability. Test CoverageMissing:
Suggestion: Additional Notes
RecommendationsHigh Priority:
Medium Priority:
Low Priority:
Overall AssessmentThis is a solid improvement to shutdown observability and correctness. The code quality is good and follows the project's conventions. The main gap is test coverage for the new behavior. The implementation is sound but would benefit from integration tests to ensure the shutdown flow works as expected under various scenarios. Recommendation: Approve with suggestions for follow-up test additions. |
ef06c0e to
f5a5102
Compare

No description provided.