digidem / digidem/comapeo-core-react-native
IPC backpressure / flow control on send path
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 1
- Forks
- 0
- Avg merge
- 8h 24m
- Merged PRs (30d)
- 9
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Kotlin NodeJSIPC.kt#L36 and backend/lib/message-port.js#L78-L94, then read the backpressure examples in docs/bare-architecture.md and §2 of docs/build-architecture-plan.md. Define and document the overflow policy and make both send paths enforce bounded behavior; done means sustained slow-peer sends no longer allow unbounded queue growth.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, kotlin
- Domain
- backend, mobile, networking
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100