Skip to content

Conversation

@rdaum
Copy link
Owner

@rdaum rdaum commented Jun 22, 2025

No description provided.

  * Split message handling and physical transport over ZMQ/bincode
  * Makes it more easily mockable/testable
@rdaum rdaum requested a review from Copilot June 22, 2025 20:10

This comment was marked as outdated.

@rdaum rdaum requested a review from Copilot June 23, 2025 02:51

This comment was marked as resolved.

  * Split workers stuff up by function, just like RPC
  * Move both into their own directory for sanitation
@rdaum rdaum force-pushed the rd/rpc-server-again branch from bbc0903 to e14e79a Compare June 23, 2025 03:02
@rdaum rdaum requested a review from Copilot June 23, 2025 03:03
Copy link
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 refactors the daemon by modularizing worker and RPC logic, introducing a task monitor and a new system control handle, and cleaning up legacy code and comments.

  • Added structured workers and rpc modules, separating transport, server, and session concerns
  • Introduced TaskMonitor for task lifecycle management and replaced the old sys_ctrl with system_control.rs
  • Updated main.rs to wire up new interfaces and removed outdated comments and legacy files

Reviewed Changes

Copilot reviewed 14 out of 18 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
crates/daemon/src/workers/transport.rs New ZMQ transport layer for worker communication
crates/daemon/src/workers/server.rs Worker server coordinator and threading setup
crates/daemon/src/workers/mod.rs Module declarations for workers
crates/daemon/src/task_monitor.rs TaskMonitor implementation for task lifecycle
crates/daemon/src/system_control.rs New SystemControlHandle implementation
crates/daemon/src/sys_ctrl.rs Removed legacy sys_ctrl implementation
crates/daemon/src/rpc/transport.rs New ZMQ transport for RPC with proxying
crates/daemon/src/rpc/session.rs Updated RpcSession and SessionActions variants
crates/daemon/src/rpc/server.rs New RPC server coordinator and threading logic
crates/daemon/src/rpc/mod.rs Module declarations for RPC
crates/daemon/src/main.rs Updated main wiring to use new modules
crates/daemon/src/lib.rs Adjusted crate attributes (recursion limit)
crates/daemon/src/connections/in_memory.rs Removed outdated compatibility comments
.licensure.yml Added cowbell to licensing exclusions

public_key,
private_key,
zmq_ctx.clone(),
&args.workers_request_listen,
Copy link

Copilot AI Jun 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing workers_request_listen to WorkersServer::new for the workers_broadcast parameter seems incorrect; consider using the broadcast endpoint (e.g., args.workers_broadcast) instead.

Suggested change
&args.workers_request_listen,
&args.workers_broadcast,

Copilot uses AI. Check for mistakes.
message_handler: Arc<H>,
) -> eyre::Result<()> {
let num_io_threads = self.zmq_context.get_io_threads()?;
info!("0mq server listening on {rpc_endpoint} with {num_io_threads} IO threads");
Copy link

Copilot AI Jun 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log message uses "0mq" (zero) instead of "ZMQ"; consider updating to "ZMQ" for clarity.

Suggested change
info!("0mq server listening on {rpc_endpoint} with {num_io_threads} IO threads");
info!("ZMQ server listening on {rpc_endpoint} with {num_io_threads} IO threads");

Copilot uses AI. Check for mistakes.
match selector.wait_timeout(timeout) {
Ok((index, result)) => {
let client_id = task_client_ids[index].1;
let task_id = task_client_ids[index].0;
Copy link

Copilot AI Jun 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] This task_id shadows a later variable of the same name inside the nested match; consider renaming one (e.g., indexed_task_id) to avoid confusion.

Suggested change
let task_id = task_client_ids[index].0;
let indexed_task_id = task_client_ids[index].0;

Copilot uses AI. Check for mistakes.
@rdaum rdaum merged commit 1697728 into main Jun 23, 2025
12 checks passed
@rdaum rdaum deleted the rd/rpc-server-again branch August 28, 2025 19:46
@rdaum rdaum restored the rd/rpc-server-again branch November 21, 2025 00:05
@rdaum rdaum deleted the rd/rpc-server-again branch December 31, 2025 01:29
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.

2 participants