Skip to content

IPC backpressure / flow control on send path #27

@gmaclennan

Description

@gmaclennan

Both sides of the UDS IPC can grow their send queues unboundedly if the peer is slow to drain:

  • Kotlin: `NodeJSIPC.kt#L36` uses `Channel(Channel.UNLIMITED)` for sends.
  • Backend: `backend/lib/message-port.js#L78-L94` queues messages without bound while `#state === 'idle'`.

Bare's `WOULD_BLOCK`-driven Duplex applies real backpressure (see `docs/bare-architecture.md`, also called out in `docs/build-architecture-plan.md` §2). Worth adopting that pattern: cap the queue, signal back-pressure to the producer, drop or block on overflow per a documented policy.

Orthogonal to runtime swap. Worth fixing anyway — current behaviour can mask unbounded memory growth under sustained load.

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