fix: map uncertain runtime store commits

This commit is contained in:
2026-09-26 22:08:00 +09:00
parent 91d1b1fedd
commit 7df2e20cf3
+25
View File
@@ -5537,6 +5537,12 @@ fn embedded_runtime_diagnostic(error: &EmbeddedRuntimeError) -> RuntimeDiagnosti
"Worker metadata deletion failed; the persisted Worker identity was retained for retry"
.to_string(),
),
EmbeddedRuntimeError::StoreCommitOutcomeUnknown { .. } => diagnostic(
"embedded_runtime_store_commit_unknown",
HostDiagnosticSeverity::Error,
"Embedded Runtime storage commit is uncertain; reconcile the Worker before retrying"
.to_string(),
),
EmbeddedRuntimeError::StoreIo { .. }
| EmbeddedRuntimeError::StoreMissing { .. }
| EmbeddedRuntimeError::StoreCorrupt { .. } => diagnostic(
@@ -5971,6 +5977,25 @@ mod tests {
assert!(!diagnostic.message.contains("/private/runtime"));
}
#[test]
fn embedded_store_commit_unknown_diagnostic_is_path_free() {
let diagnostic = embedded_runtime_diagnostic(
&EmbeddedRuntimeError::StoreCommitOutcomeUnknown {
operation: "sync Worker aggregate directory",
path: std::path::PathBuf::from("/private/runtime/workers/worker.json"),
source: std::io::Error::other("raw fsync failure"),
},
);
assert_eq!(
diagnostic.code,
"embedded_runtime_store_commit_unknown"
);
assert_eq!(diagnostic.severity, HostDiagnosticSeverity::Error);
assert!(!diagnostic.message.contains("/private/runtime"));
assert!(!diagnostic.message.contains("raw fsync failure"));
}
#[test]
fn strict_remote_runtime_dns_resolution_has_a_short_timeout() {
let error = resolve_remote_addresses_with_timeout(Duration::from_millis(1), || {