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

pubsub: fix a subtle race in catch up logic for barely active subs #247

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/corro-agent/src/api/public/pubsub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ pub async fn catch_up_sub(
for i in 0..5 {
min_change_id = last_change_id + 1;

if change_id > min_change_id {
if change_id >= min_change_id {
// missed some updates!
info!(sub_id = %matcher.id(), "attempt #{} to catch up subcription from change id: {change_id:?} (last: {last_change_id:?})", i+1);

Expand All @@ -547,7 +547,7 @@ pub async fn catch_up_sub(
// sleep 100 millis
tokio::time::sleep(Duration::from_millis(100)).await;
}
if change_id > min_change_id {
if change_id >= min_change_id {
_ = evt_tx
.send(error_to_query_event_bytes_with_meta(
&mut buf,
Expand Down
Loading