worker: run sub-workers as internal sessions

This commit is contained in:
2026-08-07 01:44:04 +09:00
parent 485918ebe3
commit c79db24016
13 changed files with 531 additions and 2260 deletions
+1 -26
View File
@@ -29,7 +29,6 @@ use session_store::{
use tokio::net::UnixStream;
use tokio::process::Command;
use crate::runtime::dir::SpawnedWorkerRecord;
use crate::runtime::worker_allocation;
use crate::spawn::comm_tools::connect_and_send;
use crate::spawn::registry::SpawnedWorkerRegistry;
@@ -44,7 +43,6 @@ pub struct WorkerDiscovery<St> {
runtime_base: PathBuf,
cwd: Option<PathBuf>,
store_dir: Option<PathBuf>,
spawned_registry: Arc<SpawnedWorkerRegistry>,
}
impl<St> WorkerDiscovery<St>
@@ -56,7 +54,7 @@ where
self_worker_name: String,
runtime_base: PathBuf,
cwd: Option<PathBuf>,
spawned_registry: Arc<SpawnedWorkerRegistry>,
_spawned_registry: Arc<SpawnedWorkerRegistry>,
) -> Self {
let store_dir = store.root_dir();
Self {
@@ -65,7 +63,6 @@ where
runtime_base,
cwd,
store_dir,
spawned_registry,
}
}
@@ -250,20 +247,6 @@ where
}
}
// The live in-memory registry covers just-spawned children even if a
// state write failed after the process became reachable. It is an
// additive visibility hint, not the source of Worker metadata.
for record in self.spawned_registry.list().await {
visible
.entry(record.worker_name.clone())
.or_insert(VisibilityReason::SpawnedChild);
child_sockets.insert(record.worker_name.clone(), record.socket_path.clone());
comm_registry.insert(
record.worker_name.clone(),
CommRegistryInfo::from_record(&record),
);
}
Ok(VisibilitySet {
visible,
child_sockets,
@@ -569,14 +552,6 @@ impl CommRegistryInfo {
scope_delegated: Vec::new(),
}
}
fn from_record(record: &SpawnedWorkerRecord) -> Self {
Self {
registered: true,
socket_path: Some(record.socket_path.clone()),
scope_delegated: record.scope_delegated.clone(),
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]