Replace ResourceWatcher with SnapshotWatcher#6796
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughMigrates xDS subscription from stream-style callbacks (ResourceWatcher, XdsStreamSubscriber) to snapshot-style SnapshotWatcher with a CompositeSnapshotWatcher fan-out and updates storage, coordinator, adapters, and tests to use onUpdate(value, error). ChangesXDS Watcher Architecture Refactor
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
🚥 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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6796 +/- ##
============================================
+ Coverage 74.46% 75.00% +0.54%
- Complexity 22234 24914 +2680
============================================
Files 1963 2214 +251
Lines 82437 92667 +10230
Branches 10764 12106 +1342
============================================
+ Hits 61385 69509 +8124
- Misses 15918 17370 +1452
- Partials 5134 5788 +654 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Motivation:
Simplify the internal xDS resource watcher contract from three callbacks (
onChanged,onError,onResourceDoesNotExist) to a singleonUpdate(@Nullable T, @Nullable Throwable)by replacingResourceWatcher/XdsStreamSubscriberwith the existingSnapshotWatcher/newCompositeSnapshotWatcher.Modifications:
ResourceWatcher,XdsStreamSubscriber, andDummyResourceWatcherCompositeSnapshotWatcheras a drop-in replacement forXdsStreamSubscriberSubscriberStorage,StateCoordinator,ConfigSourceHandler,ResourceNode, andResourceNodeAdapterto use the new typesStateCoordinatorTestandSubscriberStorageTestto useSnapshotWatcherlambdasResult: