Before Creating the Bug Report
Runtime platform environment
All platforms.
RocketMQ version
develop branch.
JDK Version
Not applicable.
Describe the Bug
GrpcClientSettingsManager.offlineClientLiteSubscription assumes a lite consumer's cached Settings always has at least one subscription entry:
String topic = settings.getSubscription().getSubscriptions(0).getTopic().getName();
String group = settings.getSubscription().getGroup().getName();
If a lite consumer has incomplete settings, for example ClientType.LITE_PUSH_CONSUMER with no subscription entries, this path throws an IndexOutOfBoundsException. The exception is caught by the broad catch block, but the cleanup path then logs an error with the full settings object and skips the offline cleanup through an exceptional path.
Steps to Reproduce
- Build
Settings with clientType = LITE_PUSH_CONSUMER.
- Do not add any subscription entries.
- Call
GrpcClientSettingsManager.offlineClientLiteSubscription(ctx, clientId, settings).
- The method tries to read
getSubscriptions(0) before validating the count.
What Did You Expect to See?
Incomplete or malformed lite-consumer settings should be ignored by the offline cleanup path before indexing into the subscription list. No IndexOutOfBoundsException should be needed for control flow.
What Did You See Instead?
The method relies on the catch block after getSubscriptions(0) throws IndexOutOfBoundsException, and logs the full settings object at error level.
Additional Context
This is a small Proxy gRPC runtime cleanup hardening issue. It keeps client disconnect/offline handling from producing noisy error logs for incomplete settings and avoids logging full settings unnecessarily.
Before Creating the Bug Report
Runtime platform environment
All platforms.
RocketMQ version
develop branch.
JDK Version
Not applicable.
Describe the Bug
GrpcClientSettingsManager.offlineClientLiteSubscriptionassumes a lite consumer's cachedSettingsalways has at least one subscription entry:If a lite consumer has incomplete settings, for example
ClientType.LITE_PUSH_CONSUMERwith no subscription entries, this path throws anIndexOutOfBoundsException. The exception is caught by the broad catch block, but the cleanup path then logs an error with the full settings object and skips the offline cleanup through an exceptional path.Steps to Reproduce
SettingswithclientType = LITE_PUSH_CONSUMER.GrpcClientSettingsManager.offlineClientLiteSubscription(ctx, clientId, settings).getSubscriptions(0)before validating the count.What Did You Expect to See?
Incomplete or malformed lite-consumer settings should be ignored by the offline cleanup path before indexing into the subscription list. No
IndexOutOfBoundsExceptionshould be needed for control flow.What Did You See Instead?
The method relies on the catch block after
getSubscriptions(0)throwsIndexOutOfBoundsException, and logs the full settings object at error level.Additional Context
This is a small Proxy gRPC runtime cleanup hardening issue. It keeps client disconnect/offline handling from producing noisy error logs for incomplete settings and avoids logging full settings unnecessarily.