Skip to content

Every other entry point takes the root lock #114

Open

Description

@MatiasFernandez

Blocked by #113. Adding the lock to paths that take none today is safe only once nothing nests the old lock.

Problem. These still bypass any lock:

  • uninstall. Its only guard is findStone(), which doesn't see a download or a prepare in progress. Uninstalling in one window while another sets up leaves a half-installed root.
  • "Reinstall Python" (reinstallGrail).
  • gemdb.restartMcpServer.
  • The gemdb.externalDatabase.* listener's stopMcpServer.
  • The gemdb.mcp.readOnly toggle. Every open window's configuration listener restarts the router, so connected agents are dropped once per window.

Scope:

  1. Run the bring-up entry points above through the lock.
    • For the toggle, record the router's mode in RouterState (readOnly; the field doesn't exist yet) and restart only when the recorded mode differs. A missing field counts as different, which costs one extra restart beside older versions.
    • reinstallGrail and restartMcpServer may be renamed or replaced by Grail and MCP versioning: gaps the new install mechanism must not inherit #110; check before starting.
  2. uninstall takes withRootLock({contention:'skip'}). When the lock is held, refuse with: "Another window is setting up or starting GemDB. Try again when it finishes."
  3. CHANGELOG entry.

Manual check:

  • Toggle read-only with two windows open: one restart.
  • Uninstall while another window is starting GemDB: refused.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

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