Skip to content

Non-blocking State/Event writes in the concurrent scheduler #57

Description

@qinhaihong-red

Parent

#4

What to build

Found by the #4 review (deferred — low severity at v0.1's agent-CLI workload; ADR 0003 points this work toward the failure-semantics/await issues).

State writes (synchronous SQLite commit, fsync-class) and Event-log appends run directly on the asyncio event loop between scheduler wakeups. While the loop blocks in a commit, the loop-resident pipe readers from communicate() cannot drain, so several simultaneously-chatty subprocesses whose output exceeds the OS pipe buffer (~64KB) block on write and the parallelism the scheduler exists to provide degrades toward serial. Make state/event persistence not stall in-flight pipe draining — e.g. batch commits per wakeup, or offload the blocking writes off the loop.

Acceptance criteria

  • State/Event persistence does not block in-flight subprocess pipe draining under concurrency
  • Durability of recorded attempts/timestamps/events is preserved (no lost records on crash)
  • A test demonstrates concurrent chatty branches are not serialized by state writes

Blocked by

Activity

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 requestready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions