Skip to content

fix: use unbounded channel for worker write queue#157

Open
ltungv wants to merge 1 commit into
beava-dev:mainfrom
ltungv:fix/153-deadlock-waiting-on-channels
Open

fix: use unbounded channel for worker write queue#157
ltungv wants to merge 1 commit into
beava-dev:mainfrom
ltungv:fix/153-deadlock-waiting-on-channels

Conversation

@ltungv
Copy link
Copy Markdown
Contributor

@ltungv ltungv commented May 30, 2026

prevent deadlock by making one of the channels unbounded so that send never blocks on the apply thread.

worker's write channel size grows with the process rate of the apply thread. flushes are also assumed to be relatively cheap. keeping read_rx bounded also prevents the system from being flooded by external requests.

closes #153

local checks

PASS  cargo fmt --all --check  (1s)
PASS  cargo clippy --workspace --all-targets --features testing -- -D warnings  (0s)
PASS  cargo test --workspace --features testing  (56s)
PASS  ruff check python/  (0s)
PASS  mypy --strict beava/
PASS  pytest python (v0 acceptance suite)  (14s)

worker write channel size grows with the process rate of the apply
thread. flushes are also assumed to be relatively cheap. keeping
`read_rx` bounded also prevent the system from being flooded by external
requests.
@ltungv ltungv requested a review from petrpan26 as a code owner May 30, 2026 16:47
@Khanathan
Copy link
Copy Markdown

wow, massive PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] apply thread and io worker threads deadlock waiting on channels

2 participants