<!-- llms-explorer concept facts · https://llms-explorer.com/tree/pinned-unified-node-runner-cleanup-rejection-and-resource-release-isolation/ · pack 2026-11-02 · ~1806 tokens -->

# Pinned unified Node runner cleanup rejection and resource-release isolation

> Source-anchored research for Pinned unified Node runner cleanup rejection and resource-release isolation. Run status: COMPLETED.

Parent: [MongoDB Drivers](https://llms-explorer.com/tree/mongodb-drivers/) · 4 facets · 6 facts · page: https://llms-explorer.com/tree/pinned-unified-node-runner-cleanup-rejection-and-resource-release-isolation/

## How it works

- At the pinned Node driver commit, the test runner’s finally block awaits utilClient.close(), the optional AstrolabeResultsWriter instance through writer.write() when WORKLOAD_SPECIFICATION is truthy, then entities?.cleanup(). Conditional control-flow inference: rejection of utilClient.close() skips both output and entity cleanup; rejection of writer.write() skips entity cleanup after utility-client closure. Finally guarantees entry, not completion of every statement. (medium confidence) — [source](https://raw.githubusercontent.com/mongodb/node-mongodb-native/e10c7a1901e1cbab7fbe33422806a0994abb6e3d/test/tools/unified-spec-runner/runner.ts) · [also](https://tc39.es/ecma262/2022/multipage/ecmascript-language-statements-and-declarations.html) · [also](https://tc39.es/ecma262/2022/multipage/control-abstraction-objects.html) · [also](https://tc39.es/ecma262/2022/multipage/ecmascript-data-types-and-values.html) · [also](https://raw.githubusercontent.com/mongodb/node-mongodb-native/e10c7a1901e1cbab7fbe33422806a0994abb6e3d/test/tools/unified-spec-runner/astrolabe_results_writer.ts)

## Problems, failure modes and limitations

- In the pinned Node implementation, the cleanup method of EntitiesMap awaits fail-point disabling, then closes cursors, closes streams, ends sessions with force:true, closes clients and clears the map. A fail-point rejection skips all later stages. A cursor rejection skips remaining cursors and every later stage; a stream rejection skips remaining streams, sessions, clients and clear; a session rejection skips remaining sessions, clients and clear; a client rejection skips remaining clients and clear. Previously completed calls are not undone. These consequences assume the respective call actually rejects. (medium confidence) — [source](https://raw.githubusercontent.com/mongodb/node-mongodb-native/e10c7a1901e1cbab7fbe33422806a0994abb6e3d/test/tools/unified-spec-runner/entities.ts) · [also](https://tc39.es/ecma262/2022/multipage/ecmascript-language-statements-and-declarations.html) · [also](https://tc39.es/ecma262/2022/multipage/ecmascript-data-types-and-values.html)
- At the pinned UTF specification revision, the runner SHOULD continue cleanup after unexpected errors while skipping further assertions. It MUST disable configured fail points on their original servers, allow external access to entities before clearing the entity map, end sessions, close cursors and streams, and terminate open transactions when the test started one. The pinned Node rejection paths can bypass prescribed cleanup; finally alone does not isolate release failures. Astrolabe entity access before clearing fits the external-access requirement, but that requirement does not prescribe making release conditional on file output. The separately retrieved workload executor specification and the cited driver-specification clarification require output even for propagated runner errors; neither establishes that this Node writer recovers from filesystem failure. This is a conditional source-level comparison, not a demonstrated production leak. (medium confidence) — [source](https://raw.githubusercontent.com/mongodb/specifications/775c4bce1bfe1c409b947eae1f3eab6975fccfe3/source/unified-test-format/unified-test-format.md) · [also](https://raw.githubusercontent.com/mongodb/node-mongodb-native/e10c7a1901e1cbab7fbe33422806a0994abb6e3d/test/tools/unified-spec-runner/runner.ts) · [also](https://raw.githubusercontent.com/mongodb/node-mongodb-native/e10c7a1901e1cbab7fbe33422806a0994abb6e3d/test/tools/unified-spec-runner/entities.ts) · [also](https://raw.githubusercontent.com/mongodb/node-mongodb-native/e10c7a1901e1cbab7fbe33422806a0994abb6e3d/test/tools/unified-spec-runner/astrolabe_results_writer.ts) · [also](https://mongodb-labs.github.io/drivers-atlas-testing/spec-workload-executor.html) · [also](https://jira.mongodb.org/browse/DRIVERS-1652)

## Comparisons and alternatives

- A rejection escaping the runner’s finally block replaces an earlier test error or successful completion under ECMAScript try-finally semantics. Consequently a utility-close, Astrolabe-write or entity-cleanup error can become the surfaced failure instead of the original assertion or operation error; the pinned block does not aggregate both errors. (medium confidence) — [source](https://raw.githubusercontent.com/mongodb/node-mongodb-native/e10c7a1901e1cbab7fbe33422806a0994abb6e3d/test/tools/unified-spec-runner/runner.ts) · [also](https://tc39.es/ecma262/2022/multipage/ecmascript-language-statements-and-declarations.html) · [also](https://tc39.es/ecma262/2022/multipage/ecmascript-data-types-and-values.html)

## Facts and statements

- At the same Node pin, the write method of AstrolabeResultsWriter reads entities, then awaits events.json before results.json. Rejection of the first write skips the second; rejection of either write propagates into the test runner’s finally block and prevents the later entity cleanup call. Entity access or serialization throwing also exits this path. This identifies skipped calls, not whether files were partially written. (medium confidence) — [source](https://raw.githubusercontent.com/mongodb/node-mongodb-native/e10c7a1901e1cbab7fbe33422806a0994abb6e3d/test/tools/unified-spec-runner/astrolabe_results_writer.ts) · [also](https://raw.githubusercontent.com/mongodb/node-mongodb-native/e10c7a1901e1cbab7fbe33422806a0994abb6e3d/test/tools/unified-spec-runner/runner.ts) · [also](https://tc39.es/ecma262/2022/multipage/ecmascript-data-types-and-values.html) · [also](https://tc39.es/ecma262/2022/multipage/ecmascript-language-statements-and-declarations.html)
- At the pinned Node commit, the disableFailPoints method of FailPointMap uses Promise.all over mapped async callbacks. One callback rejection rejects the aggregate and prevents subsequent EntitiesMap cleanup stages, but other callbacks have already started and Promise.all does not cancel them. Each callback creates a temporary client, awaits connect(), sends configureFailPoint with mode off, asserts ok equals 1, then awaits client.close(). A connect rejection is logged and rethrown; a command rejection or assertion throw also bypasses that callback’s trailing client.close(). The callback has no finally ensuring a close attempt. These are conditional source paths, not proof of a surviving connection. (medium confidence) — [source](https://raw.githubusercontent.com/mongodb/node-mongodb-native/e10c7a1901e1cbab7fbe33422806a0994abb6e3d/test/tools/unified-spec-runner/entities.ts) · [also](https://tc39.es/ecma262/2022/multipage/control-abstraction-objects.html) · [also](https://tc39.es/ecma262/2022/multipage/ecmascript-data-types-and-values.html) · [also](https://tc39.es/ecma262/2022/multipage/ecmascript-language-statements-and-declarations.html)
