Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subscription channel can run out of capacity and drop events #183

Open
pborzenkov opened this issue Apr 11, 2024 · 1 comment
Open

Subscription channel can run out of capacity and drop events #183

pborzenkov opened this issue Apr 11, 2024 · 1 comment

Comments

@pborzenkov
Copy link
Contributor

The broadcast channel used by subscriptions (

let (sub_tx, sub_rx) = broadcast::channel(10240);
) can run out of capacity and skip the events in case the data is read really fast from the disk.

Somehow, in this case, forward_sub_to_sender simply stops forwarding any event -

Ok((event_buf, meta)) = sub_rx.recv() => {

It looks like the select! never matches RecvError::Lagged for some reasons.

@pborzenkov
Copy link
Contributor Author

The problem with select! is fixed by #184

The actual channel capacity problem is still present. Firing up a new subscription should probably behave the same way as subscribing to existing one: the initial rows are sent via mpsc channel and the broadcast channel is used after that to send change events only.

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

No branches or pull requests

1 participant