fix: bound resumable teardown, image concurrency and delivery leases
TR-RR-06. dispose() now bounds its drain with a cleanupDeadlineMs from policy and returns the result, so a non-cooperative mutation lock or provider can no longer make teardown unbounded and an unproved drain is reported as still CLOSING instead of closed over. The checkpoint store stays open in that case, because something can still write to it. An abort is admitted physical work like an upload, so it joins the tracked set rather than being stepped over. TR-RR-07. The verification slot belongs to the raw verifier, not the wrapper. Releasing it when the caller's wait expired let an abandoned verification keep running while a new one was admitted, so repeated aborts produced more concurrent physical work than the configured cap allows. The slot is now released only once the raw tasks settle. TR-RR-04. A presigned byte source owns a fetch reader and a capability lease and its port requires close(); the delivery consumer never called it. The closeable subtype is lost in the FileByteSource projection, so a holder keeps it from the moment the lease exists and the outermost finally closes it exactly once — on success, validation failure, writer failure and abort alike. check:adapter-inventory now also fails if the shared abortable-operation primitive has no production importers. It was safe to add only once the presigned subsystems actually migrated onto it; a gate that fails CI for a documented, unfixed defect reports the wrong thing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
46e067e555
commit
5a76f95291
@@ -123,6 +123,27 @@ async function main(): Promise<void> {
|
||||
);
|
||||
}
|
||||
|
||||
// TR-RR-05. The shared abort/deadline primitive is only shared if production
|
||||
// code imports it. A helper with zero importers is a second implementation
|
||||
// waiting to happen, which is exactly how the four hand-written copies of
|
||||
// these mechanics diverged in the first place.
|
||||
const primitiveImporters = spawnSync(
|
||||
"git",
|
||||
["grep", "-l", "platform/abortable-operation.ts", "--", "src"],
|
||||
{ encoding: "utf8" },
|
||||
);
|
||||
const importers = (
|
||||
primitiveImporters.status === 0 ? primitiveImporters.stdout : ""
|
||||
)
|
||||
.split("\n")
|
||||
.filter(Boolean)
|
||||
.filter((file) => !file.endsWith("platform/abortable-operation.ts"));
|
||||
if (importers.length === 0) {
|
||||
problems.push(
|
||||
"abortable-operation: the shared primitive has no production importers",
|
||||
);
|
||||
}
|
||||
|
||||
if (problems.length > 0) {
|
||||
for (const problem of problems) console.error(problem);
|
||||
process.exitCode = 1;
|
||||
|
||||
Reference in New Issue
Block a user