fix: align worker rename followups
This commit is contained in:
@@ -78,7 +78,7 @@ pub enum SpawnError {
|
||||
Io(io::Error),
|
||||
/// runtime ディレクトリが解決できなかった (環境変数未設定等)。
|
||||
RuntimeDirUnavailable,
|
||||
PodLaunchFailed {
|
||||
WorkerLaunchFailed {
|
||||
command: WorkerRuntimeCommand,
|
||||
source: io::Error,
|
||||
},
|
||||
@@ -96,7 +96,7 @@ impl std::fmt::Display for SpawnError {
|
||||
f,
|
||||
"could not resolve runtime directory (set YOI_HOME, YOI_RUNTIME_DIR, XDG_RUNTIME_DIR, or HOME)"
|
||||
),
|
||||
Self::PodLaunchFailed { command, source } => write!(
|
||||
Self::WorkerLaunchFailed { command, source } => write!(
|
||||
f,
|
||||
"failed to launch worker runtime command `{command}`: {source}"
|
||||
),
|
||||
@@ -119,7 +119,7 @@ impl std::fmt::Display for SpawnError {
|
||||
impl std::error::Error for SpawnError {
|
||||
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
|
||||
match self {
|
||||
Self::Io(error) | Self::PodLaunchFailed { source: error, .. } => Some(error),
|
||||
Self::Io(error) | Self::WorkerLaunchFailed { source: error, .. } => Some(error),
|
||||
Self::RuntimeDirUnavailable | Self::WorkerExitedEarly { .. } | Self::Timeout => None,
|
||||
}
|
||||
}
|
||||
@@ -197,7 +197,7 @@ where
|
||||
}
|
||||
let mut child = command
|
||||
.spawn()
|
||||
.map_err(|source| SpawnError::PodLaunchFailed {
|
||||
.map_err(|source| SpawnError::WorkerLaunchFailed {
|
||||
command: config.runtime_command.clone(),
|
||||
source,
|
||||
})?;
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
## Role
|
||||
|
||||
`pod-store` owns current Pod metadata keyed by Pod name.
|
||||
`pod-store` is the legacy-named crate that owns current Worker metadata keyed by Worker name.
|
||||
|
||||
## Boundaries
|
||||
|
||||
Owns:
|
||||
|
||||
- persisted Pod metadata files
|
||||
- persisted Worker metadata files
|
||||
- current active/pending session pointers
|
||||
- resolved manifest snapshots for restoration
|
||||
- parent-visible spawned-child metadata
|
||||
@@ -23,8 +23,8 @@ Does not own:
|
||||
|
||||
## Design notes
|
||||
|
||||
Pod metadata is intentionally thin. It should answer current-state questions without duplicating transcripts or becoming a second session log.
|
||||
Worker metadata is intentionally thin. It should answer current-state questions without duplicating transcripts or becoming a second session log.
|
||||
|
||||
## See also
|
||||
|
||||
- [`../../docs/design/pod-session-state.md`](../../docs/design/pod-session-state.md)
|
||||
- [`../../docs/design/worker-session-state.md`](../../docs/design/worker-session-state.md)
|
||||
|
||||
@@ -1658,7 +1658,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pod_discovery_methods_roundtrip() {
|
||||
fn worker_discovery_methods_roundtrip() {
|
||||
let methods = [
|
||||
Method::ListWorkers,
|
||||
Method::RestoreWorker {
|
||||
@@ -1681,7 +1681,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pod_discovery_events_roundtrip() {
|
||||
fn worker_discovery_events_roundtrip() {
|
||||
let events = [
|
||||
Event::WorkersListed {
|
||||
workers: serde_json::json!([{ "worker_name": "child" }]),
|
||||
@@ -1698,7 +1698,7 @@ mod tests {
|
||||
let decoded: Event = serde_json::from_str(&json).unwrap();
|
||||
match (decoded, event) {
|
||||
(Event::WorkersListed { workers }, Event::WorkersListed { workers: expected }) => {
|
||||
assert_eq!(pods, expected)
|
||||
assert_eq!(workers, expected)
|
||||
}
|
||||
(Event::WorkerRestored { result }, Event::WorkerRestored { result: expected }) => {
|
||||
assert_eq!(result, expected)
|
||||
|
||||
Reference in New Issue
Block a user