-
Notifications
You must be signed in to change notification settings - Fork 0
Shutdown on ctrl_c #90
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
Conversation
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.
Pull request overview
This PR implements graceful shutdown on Ctrl+C/SIGINT for the Taurus service. The main changes restructure the application to use tokio::select! for monitoring multiple concurrent tasks (NATS worker and optional health service) and handle shutdown signals appropriately. The PR also includes dependency updates, improved logging throughout, and adds support for dynamic mode flow definition synchronization at startup.
Key Changes:
- Added Ctrl+C signal handling using
tokio::select!to gracefully coordinate shutdown of worker and health service tasks - Restructured main event loop to spawn tasks and monitor them for completion or shutdown signals
- Enhanced error handling and replaced
println!statements with structuredlogmacros throughout - Added dynamic mode flow synchronization at startup and corresponding configuration
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| taurus/src/main.rs | Core implementation of shutdown handling with tokio::select!, task spawning, improved logging, and dynamic mode sync |
| taurus/src/config/mod.rs | Added definitions config field and changed default mode from STATIC to DYNAMIC |
| taurus/Cargo.toml | Added "flow_service" feature flag to code0-flow dependency |
| Cargo.toml | Updated dependencies (code0-flow 0.0.19, tucana 0.0.42, async-nats 0.45.0) and added "signal" feature to tokio |
| Cargo.lock | Dependency lock file updates reflecting version changes and new transitive dependencies (walkdir, signal-hook-registry, etc.) |
| .env-example | Added DEFINITIONS environment variable example |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| FlowUpdateService::from_url( | ||
| config.aquila_url.clone(), | ||
| config.definitions.clone().as_str(), | ||
| ) | ||
| .send() | ||
| .await; |
Copilot
AI
Nov 27, 2025
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.
The result of FlowUpdateService::send().await is being ignored. If the sync fails, the application will continue without any indication of the failure. Consider logging an error or handling the failure case, e.g., if let Err(e) = FlowUpdateService::from_url(...).send().await { log::error!("Failed to sync flow definitions: {:?}", e); }
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Raphael Götz <52959657+raphael-goetz@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Raphael Götz <52959657+raphael-goetz@users.noreply.github.com>
Resolves: #89