summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/SomhairlesDream.Server/ArtifactRunCoordinator.fs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/SomhairlesDream.Server/ArtifactRunCoordinator.fs b/src/SomhairlesDream.Server/ArtifactRunCoordinator.fs
index 6cd5fd3..c77d22b 100644
--- a/src/SomhairlesDream.Server/ArtifactRunCoordinator.fs
+++ b/src/SomhairlesDream.Server/ArtifactRunCoordinator.fs
@@ -342,7 +342,15 @@ type ArtifactRunCoordinator(
elif snapshot.CompletedSteps |> Array.exists (fun recorded -> recorded = normalized) then
checkpointDigest projectId runId normalized
else
- Error ArtifactNotFound
+ // A live entry that failed or is idling (e.g. a
+ // re-run rejected because the run was already
+ // pre-published on disk) must not shadow the
+ // historical artifact; only a completed on-disk
+ // manifest may back it, so an in-flight failure
+ // never serves half-written files.
+ match snapshot.Status with
+ | "running" -> Error ArtifactNotFound
+ | _ -> completedDigest projectId runId normalized
match digest with
| Error lookupError -> Error lookupError