-
Notifications
You must be signed in to change notification settings - Fork 74
dont start tonic stream if topics are empty #2941
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
Conversation
|
This PR is part of a stack of 1 bookmark:
Created with jj-stack |
|
Claude finished @insipx's task —— View job Code Review - December 11, 2025 19:41 UTCI've reviewed the PR that introduces fake streams to avoid opening tonic connections when subscribing with empty topics/installations. The implementation is solid overall, but I have one concern about the Critical Issue: FakeEmptyStream SemanticsLocation: The impl<E: Error> FusedStream for FakeEmptyStream<E> {
fn is_terminated(&self) -> bool {
true // ← Claims to be terminated
}
}
impl<E: Error> Stream for FakeEmptyStream<E> {
fn poll_next(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
Poll::Pending // ← But returns Pending forever
}
}Problem: A stream that returns Impact: This could cause subtle bugs with stream combinators that check Recommendation: Either:
I recommend option 1 (removing Minor Issues
Positive Observations✅ Good performance optimization - Avoiding unnecessary network connections when there are no topics to subscribe to is the right approach ✅ Consistent implementation - The pattern is applied consistently across all middleware layers (auth, multi-node, read-write, readonly) ✅ Proper short-circuiting - All three subscription methods ( ✅ Clean trait design - Adding SummaryThe PR successfully solves the problem of avoiding tonic stream creation for empty topic lists. The only blocking concern is the |
Return a non-networking fake stream and avoid starting tonic streams when
|
a288874 to
debcf6c
Compare
debcf6c to
a618e13
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2941 +/- ##
==========================================
- Coverage 73.78% 73.74% -0.04%
==========================================
Files 401 402 +1
Lines 51265 51332 +67
==========================================
+ Hits 37828 37857 +29
- Misses 13437 13475 +38 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
fixes #2924
bunch of tests were failing for d14n ordered streams caused by this