Files
Vance Ingalls 504e005287 docs(engine): document idempotency invariants for resource cleanup
StreamingEncoder.close() and closeCaptureSession() are both invoked from
renderOrchestrator's HDR cleanup path with a tracked-flag pattern, but the
outer finally block may still re-call them if the inner cleanup raised
before the flag flipped. Both must therefore be idempotent.

streamingEncoder.close: add an inline comment explaining why each step
(clearTimeout, removeEventListener, stdin.end gated on !destroyed,
shared exitPromise) is safe to repeat.

closeCaptureSession: previously NOT truly idempotent under browser-pool
semantics — releaseBrowser decrements pooledBrowserRefCount, so calling
it twice for the same acquire could close a browser another session still
holds. Add per-session pageReleased/browserReleased flags to the
CaptureSession interface and gate page.close()/releaseBrowser() behind
them. Set the flag AFTER the await so a mid-cleanup throw still allows
the outer defensive call to retry the unreleased resource.
2026-04-23 03:37:44 +00:00
..
2026-04-22 22:12:34 -04:00
2026-04-22 22:12:34 -04:00
2026-04-22 22:12:34 -04:00
2026-04-22 22:12:34 -04:00