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

Fix historical sync race condition #241

Merged
merged 5 commits into from
Jun 30, 2023

Conversation

0xOlias
Copy link
Collaborator

@0xOlias 0xOlias commented Jun 30, 2023

Flaky tests made it clear that the historical sync service was occasionally failing to fully merge log filter cached intervals before emitting the syncComplete event. This was caused by a race condition. The previous design was relying on the block task worker to merge cached intervals after inserting the new one, which was unsafe because the multiple merge operations could occur at the same time. The fix introduced here adds some logic to the queue worker to merge all intervals on the last task in the queue.

@changeset-bot
Copy link

changeset-bot bot commented Jun 30, 2023

🦋 Changeset detected

Latest commit: ef6f9d6

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Jun 30, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ponder-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 30, 2023 11:12pm

@0xOlias 0xOlias merged commit 438813b into main Jun 30, 2023
@0xOlias 0xOlias deleted the olias/fix-historical-sync-race-condition branch June 30, 2023 23:14
@github-actions github-actions bot mentioned this pull request Jun 30, 2023
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