Skip to content

fact_calls: sync-start JSPI park releases lenders only in produce() — cancel/error settle paths can strand them #102

Description

@lann

Residual from the #91 fix (2026-08-10 review wave; implementation track
interpretation call 4).

#91 moved lender release onto every non-success exit of the start-call
bodies (trap rethrow, NeedsJspi bail, async-start resume-trap). One window
remains: when createSyncStartCall parks on a JSPI suspension
(blockCurrentActivation), lender release lives inside produce(). If that
suspension point settles by cancellation or by an error path that never runs
produce (SuspensionPoint reject/cancel paths), the lent handles' numLends
stay elevated forever — same failure class as #91, one layer down.

Needs: an audit of SuspensionPoint's settle paths (which ones bypass
produce?) and a release hook tied to the suspension point's terminal state
rather than to produce alone — or a scope-stack registration so the
executor-side amendment-2 unwind (contracts/intrinsics.md v0.2 amendment 2,
scope-clarified 2026-08-10) discharges it.

Site: runtime/src/intrinsics/fact_calls.ts (createSyncStartCall park);
compare runtime/src/jspi/bridge.ts SuspensionPoint settle paths.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions