Skip to content

fix(store-inmemory): restore the intended 256-event subscription buffer - #421

Draft
GraemeF wants to merge 3 commits into
mainfrom
fix/pubsub-capacity
Draft

GraemeF wants to merge 3 commits into
mainfrom
fix/pubsub-capacity

Conversation

@GraemeF

@GraemeF GraemeF commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

The in-memory store sized its subscription buffers with 2 ^ 8, which is 10 in JavaScript, not the 256 the code meant. A subscriber ten events behind blocked append while it held the store lock, so a consumer that appended to a stream it was subscribed to could deadlock.

The buffers stay bounded, now at 256. A subscriber 256 events behind still blocks append. That is deliberate: the store is for tests and similar uses, where failing beats consuming all memory.

The test lags a subscriber 100 events behind, past ten but under 256, and shows appends still complete. It times out against 2 ^ 8.

@GraemeF
GraemeF force-pushed the fix/pubsub-capacity branch from 99e110a to bcd776e Compare September 30, 2026 16:29
@GraemeF GraemeF changed the title fix(store-inmemory): stop a slow subscriber stalling appends fix(store-inmemory): restore the intended 256-event subscription buffer Sep 30, 2026
@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant