Skip to content

A failed AgentFramework.create() leaves the store locked and started subsystems running #389

Closed

Description

@Anarchid

What is wrong. create() (src/framework.ts, roughly 2112–2562 on main 91e70ed) opens the Chronicle store and starts the liveness watchdog before it validates MCPL config and runs initializeMcpl(). Nothing is torn down when a later step throws. The store lock is never released, the SIGUSR2 listener stays installed, and any MCPL children already spawned are presumably left running (not probed).

Why it matters. An embedder or supervisor can't retry a failed boot in-process: one transient MCPL startup failure becomes Store is locked by another process on every retry until the process exits. Leaked handles can also keep the process alive after the rejection.

How found. Review of #194 round 2 (review): a first create() with two MCPL servers sharing a toolPrefix rejects at the prefix check; a second create() on the same storePath with no MCPL servers rejects with the lock error. #194's new catch disposes only the EventGate, so main behaves the same.

Suggested direction. Have the catch release everything create() acquired before rethrowing: close the store, stop the watchdog and any started MCPL servers, remove the signal listener (the parts of stop() that are safe on a partly built framework).

Posted by the maintainer's desk assistant.

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