feat(indexing): support durable event processing#387
Conversation
yordis
commented
Jun 25, 2026
- Internal indexes need a durable way to keep their state aligned with committed events before query surfaces can rely on them.
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
PR SummaryMedium Risk Overview
New abstractions: Reviewed by Cursor Bugbot for commit 016775f. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
Warning Review limit reached
More reviews will be available in 39 minutes and 14 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughIntroduces indexing checkpoint and source abstractions, an indexing subscription with lifecycle and commit handling, a service that starts and stops it on system bus events, and tests covering checkpoint selection, event ordering, commit timing, and disposal. ChangesIndexing subscription stack
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/EventStore.Core/Services/Storage/Indexing/IndexingSubscription.cs`:
- Line 67: The background worker started in IndexingSubscription.ProcessEvents
is faulting asynchronously and only surfacing during DisposeAsync, which can
skip cleanup. Update the Task.Run(ProcessEvents) flow in IndexingSubscription so
worker exceptions are observed/reported as soon as they occur, and wrap the
await of _processing in DisposeAsync with a try/finally so _commitTracker,
_eventSource, and component still get disposed even when ProcessEvents fails.
- Around line 44-67: Move the `_started` state change in
`IndexingSubscription.Start` so it only happens after `component.Initialize`,
`component.ReadCheckpoint`, `_commitTracker` creation, and `_eventSource`
creation all succeed. If startup can fail after the lock is released, either set
`_started = true` at the end of the successful setup or add a `catch` that rolls
it back and disposes any partially created state before rethrowing. Use the
`Start` method and `_started` field in `IndexingSubscription` as the main points
to update.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c6664e69-f34d-41f2-b9b4-7fa59893fa1e
📒 Files selected for processing (6)
src/EventStore.Core.XUnit.Tests/Services/Storage/Indexing/IndexingSubscriptionTests.cssrc/EventStore.Core/Services/Storage/Indexing/IIndexingComponent.cssrc/EventStore.Core/Services/Storage/Indexing/IIndexingEventSource.cssrc/EventStore.Core/Services/Storage/Indexing/IndexCheckpoint.cssrc/EventStore.Core/Services/Storage/Indexing/IndexingService.cssrc/EventStore.Core/Services/Storage/Indexing/IndexingSubscription.cs
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 12af056. Configure here.
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
