implemented status heartbeat#189
Conversation
There was a problem hiding this comment.
Pull request overview
Implements a periodic “heartbeat” update of Taurus runtime status (issue #187) so the runtime continually reports Running while active, rather than only updating status at startup/shutdown.
Changes:
- Added a configurable runtime-status heartbeat interval (env-driven) to Taurus configuration.
- Started a background Tokio task in dynamic mode to periodically call
update_runtime_status(Running). - Aborted the heartbeat task during shutdown and then updated status to
Stopped.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| crates/taurus/src/config/mod.rs | Adds a new config field/env var for heartbeat interval. |
| crates/taurus/src/app/mod.rs | Spawns/aborts the heartbeat task and adjusts runtime-status service ownership for the task. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /// Runtime status heartbeat interval in seconds while Taurus is running. | ||
| /// Set to 0 to disable periodic heartbeat updates. | ||
| pub adapter_status_update_interval_seconds: u64, |
There was a problem hiding this comment.
The new config field name/env var (adapter_status_update_interval_seconds / ADAPTER_STATUS_UPDATE_INTERVAL_SECONDS) doesn’t match the docstring (“Runtime status heartbeat”). Consider renaming the field and env var to refer to runtime-status/heartbeat (and update the doc comment to mention it only applies in dynamic mode, since the status service is only initialized there).
| loop { | ||
| interval.tick().await; | ||
| status_service | ||
| .update_runtime_status(tucana::shared::execution_runtime_status::Status::Running) | ||
| .await; |
There was a problem hiding this comment.
The heartbeat loop calls update_runtime_status on every tick; that method logs at INFO level on each call and performs a network request. With the default 30s interval this can create persistent log noise and steady load on Aquila/Sagittarius. Consider lowering the log level for periodic heartbeats (or adding a lightweight/quiet update path) so normal operation doesn’t spam logs.
| } | ||
|
|
||
| async fn update_stopped_status(runtime_status_service: Option<&TaurusRuntimeStatusService>) { | ||
| async fn update_stopped_status(runtime_status_service: Option<&Arc<TaurusRuntimeStatusService>>) { |
There was a problem hiding this comment.
update_stopped_status takes Option<&Arc<TaurusRuntimeStatusService>>, which propagates the Arc into the helper’s signature. To keep the helper independent of the ownership strategy, consider taking Option<&TaurusRuntimeStatusService> and calling it with runtime_status_service.as_deref() (and similarly for other call sites).
| async fn update_stopped_status(runtime_status_service: Option<&Arc<TaurusRuntimeStatusService>>) { | |
| async fn update_stopped_status( | |
| runtime_status_service: Option<&TaurusRuntimeStatusService>, | |
| ) { |
GitLab Pipeline ActionGeneral informationLink to pipeline: https://gitlab.com/code0-tech/development/taurus/-/pipelines/2486106095 Status: Passed Job summariesdocs:previewDocumentation preview available at https://code0-tech.gitlab.io/-/development/telescopium/-/jobs/14127729616/artifacts/out/index.html |
Resolves: #187