zjncs opened a new pull request, #11149:
URL: https://github.com/apache/rocketmq/pull/11149

   ### Motivation
   
   `GrpcClientSettingsManager.offlineClientLiteSubscription` only took 
`subscriptions(0)` to build the `COMPLETE_REMOVE` LiteSubscriptionDTO:
   
   1. A lite consumer subscribing to multiple topics left stale subscriptions 
on the broker for every topic after the first one.
   2. When the subscription list was empty, `getSubscriptions(0)` threw 
`IndexOutOfBoundsException`, which the surrounding catch block swallowed — so 
the cleanup was silently skipped entirely, and the stale lite subscription 
could trigger `LITE_SUBSCRIPTION_QUOTA_EXCEEDED` on the next connect.
   
   ### Modifications
   
   Iterate over all subscription entries and send one `COMPLETE_REMOVE` per 
topic; an empty list now simply sends nothing.
   
   ### Verification
   
   Fail-before (new tests, run against the unpatched code):
   
   ```
   Wanted 2 times but was 1 -- 
GrpcClientSettingsManagerTest#testOfflineClientLiteSubscription_MultipleTopics_AllSubscriptionsRemoved
   (multiplex: syncLiteSubscription invoked for only the first of two 
subscribed topics)
   ```
   
   Pass-after:
   
   ```
   Tests run: 9, Failures: 0, Errors: 0, Skipped: 0 -- 
GrpcClientSettingsManagerTest
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to