Skip to content

Add run_until_shutdown utility for services#201

Draft
malzag wants to merge 5 commits intomainfrom
agent-disconnect-fix
Draft

Add run_until_shutdown utility for services#201
malzag wants to merge 5 commits intomainfrom
agent-disconnect-fix

Conversation

@malzag
Copy link
Copy Markdown
Collaborator

@malzag malzag commented Mar 27, 2026

…cpp arbiter thread panicking

@malzag malzag changed the title add tests that cover: 1. reconnecting agent after shutdown, 2. llama … Add run_until_shutdown utility for services Mar 28, 2026
@malzag malzag marked this pull request as ready for review March 28, 2026 00:48
Copilot AI review requested due to automatic review settings March 28, 2026 00:48
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 introduces a shared run_until_shutdown helper to simplify service loops and standardize shutdown behavior.

Changes:

  • Added run_until_shutdown utility (with tests) and exported it from paddler’s public module tree.
  • Refactored several services to use run_until_shutdown instead of hand-rolled loop { tokio::select! { ... } } patterns.
  • Relaxed async_trait Send requirements for the Service trait and its implementations (#[async_trait(?Send)]).

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
paddler/src/run_until_shutdown.rs New shutdown-driven loop helper plus unit tests.
paddler/src/lib.rs Exposes the new run_until_shutdown module.
paddler/src/service.rs Updates Service trait to #[async_trait(?Send)].
paddler/src/service_manager.rs Updates test Service impls to #[async_trait(?Send)].
paddler/src/balancer/statsd_service/mod.rs Refactors periodic metrics reporting to use run_until_shutdown.
paddler/src/balancer/reconciliation_service.rs Refactors reconciliation loop to use run_until_shutdown.
paddler/src/agent/reconciliation_service.rs Refactors reconciliation loop to use run_until_shutdown and changes behavior on channel close to return an error.
paddler/src/agent/management_socket_client_service.rs Refactors keep-alive loop to use run_until_shutdown.
paddler/src/agent/llamacpp_arbiter_service.rs Refactors arbiter loop to use run_until_shutdown and uses the provided shutdown receiver for forwarded requests.
paddler/src/balancer/web_admin_panel_service/mod.rs Switches to #[async_trait(?Send)].
paddler/src/balancer/management_service/mod.rs Switches to #[async_trait(?Send)].
paddler/src/balancer/inference_service/mod.rs Switches to #[async_trait(?Send)].
paddler/src/balancer/compatibility/openai_service/mod.rs Switches to #[async_trait(?Send)].
package-lock.json Adds "peer": true metadata to multiple entries.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@malzag malzag marked this pull request as draft March 28, 2026 01:38
@malzag malzag added this to the 3.1.0 Release milestone Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants