fix(filesystem): preserve opaque caller reasons through cleanup

Do not interpret exact caller cancellation reasons as descriptor ownership records. Preserve checkpoint-shaped reasons through successful close retry and supply cancellation context in direct signal-aware cleanup consumers.

Validation: 156 focused tests across 14 files passed; no native provider execution. Refs #4610
This commit is contained in:
morluto committed 2026-10-17 08:25:01 +08:00
1 parent 3bd9aa3484
commit 746a044e42
5 files changed
+91 -34

No files matched your search

+2 -1
View File
@@ -88,8 +88,9 @@ const resolveSourceHead = async (
try {
return await readRegularFile(path, { signal });
} catch (cause: unknown) {
if (signal?.aborted === true && cause === signal.reason) throw cause;
if (!(cause instanceof RegularFileCleanupFailure)) throw cause;
const retry = await retryRegularFileCleanup(cause, resources);
const retry = await retryRegularFileCleanup(cause, resources, signal);
if (
retry.outcome.kind === "failed" &&
errorCode(retry.outcome.cause) !== "ENOENT"