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

+3 -1
View File
@@ -236,8 +236,10 @@ const readCapture = async (
try {
return ok({ bytes: await readRegularFile(path, { signal }) });
} catch (cause: unknown) {
if (signal?.aborted === true && cause === signal.reason)
return err(captureReadFailure(path, cause, signal));
if (cause instanceof RegularFileCleanupFailure) {
const retry = await retryRegularFileCleanup(cause, resources);
const retry = await retryRegularFileCleanup(cause, resources, signal);
const cleanup = {
reason: retry.cleanup?.reason ?? errorMessage(cause.cleanupCause),
incomplete: retry.cleanup !== undefined,