Skip to content

[Bug] Proxy lite client offline cleanup indexes empty subscriptions #10681

Description

@Aias00

Before Creating the Bug Report

  • I have searched the existing issues and pull requests.

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

  1. Build Settings with clientType = LITE_PUSH_CONSUMER.
  2. Do not add any subscription entries.
  3. Call GrpcClientSettingsManager.offlineClientLiteSubscription(ctx, clientId, settings).
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions