[ISSUE #10681] Skip lite offline cleanup without subscriptions - #10682
[ISSUE #10681] Skip lite offline cleanup without subscriptions#10682Aias00 wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #10682 +/- ##
=============================================
- Coverage 48.31% 48.23% -0.09%
+ Complexity 13511 13485 -26
=============================================
Files 1380 1380
Lines 101091 101093 +2
Branches 13101 13102 +1
=============================================
- Hits 48844 48759 -85
- Misses 46285 46346 +61
- Partials 5962 5988 +26 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review by github-manager-bot
Summary
Adds an early-return guard in GrpcClientSettingsManager.offlineClientLiteSubscription() to skip processing when the lite-consumer settings have no subscription section or zero subscription entries, preventing an IndexOutOfBoundsException on getSubscriptions(0). Includes a regression test.
Findings
- [Info]
GrpcClientSettingsManager.java:239— The guard!settings.hasSubscription() || settings.getSubscription().getSubscriptionsCount() == 0correctly prevents theIndexOutOfBoundsExceptiondescribed in #10681. Clean and minimal. - [Info]
GrpcClientSettingsManagerTest.java:159-172— Good regression test usingLITE_PUSH_CONSUMERwith a group but no subscription entries. VerifiessyncLiteSubscriptionis never called.
Suggestions
- Consider also testing with
LITE_SIMPLE_CONSUMERclient type for completeness, since the method guards bothLITE_PUSH_CONSUMERandLITE_SIMPLE_CONSUMERat line 235-237. This is optional — the current test already validates the new guard logic.
Verdict
The fix is correct, minimal, and well-tested. LGTM. ✅
Automated review by github-manager-bot
|
Thanks for the PR. However, this guards a state that cannot occur by design. In the liteTopic model, the bind topic is mandatory on the SDK side — a lite consumer always carries exactly one bind-topic entry in its Settings, established before any lite subscription exists. So If this state ever appeared, it would signal a protocol violation that should fail loudly (which the existing catch + error log already does), not be silently skipped on the offline path. I'd suggest walking through the end-to-end liteTopic subscription flow (Settings sync → bind topic → SyncLiteSubscription) first — it would make it clear why this invariant holds. |
sounds good to me |
Summary
subscriptions(0)for incomplete lite-consumer settings.Motivation
Closes #10681.
GrpcClientSettingsManager.offlineClientLiteSubscriptionpreviously assumed lite-consumer settings always contain at least one subscription entry. Incomplete settings could throwIndexOutOfBoundsExceptionand fall into the broad error log path, including the full settings object.Tests
mvn -pl proxy -Dtest=GrpcClientSettingsManagerTest -DfailIfNoTests=false testResult: BUILD SUCCESS; 8 tests passed; checkstyle reported 0 violations. The run emits existing JaCoCo instrumentation warnings under the local JDK, and one existing test intentionally logs a simulated sync failure, but tests and build completed successfully.