Skip to content

Journal writer lock on Windows #1299

Open

Description

@DROOdotFOO

Priority: low. Tracked from the OMP pivot plan (ADR-0042, PR #1297), round 3.

Problem

Raxol.Agent.Journal.FileStore.Writer takes its per-session lock only on Unix with a kill binary (writer.ex:782-784). On Windows it runs lockless (writer.ex:717-722), so two BEAMs writing the same session directory produce duplicate offsets and damage the journal (writer.ex:21-24).

Decision for now

P4a of the OMP pivot plan refuses agent_spawn on Windows with a stated reason (fail closed). App tools and the rest of raxol mcp keep working on Windows.

What closing this needs

  • A Windows lock primitive for writer.lock. Candidates: an exclusive share-mode open held for the Writer's lifetime, or O_EXCL create plus a process-handle liveness check in place of kill -0.
  • A Windows CI leg that exercises it: a second opener is refused while the first lives, and a stale lock left by a killed process is reclaimed.
  • Then lift the agent_spawn refusal on Windows.

Manual testing

  • On Windows, two raxol mcp processes: agent_spawn c1 in both, and the second is refused
  • Kill the first process, then spawn c1 again: it succeeds and the journal offsets continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions