apache / apache/rocketmq

[Bug] ClusterMessageService.batchAckMessage throws on empty handle list

Open Beginner friendly
#10,780 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
22.6k
Forks
12k
Avg merge
3d 1h
Merged PRs (30d)
27

Description

### Before Creating the Bug Report

- [x] I have searched the existing issues and pull requests.

### Runtime platform environment

N/A

### RocketMQ version

develop branch

### JDK Version

N/A

### Describe the Bug

`ClusterMessageService.batchAckMessage()` builds `extraInfoList` from `handleList` and then immediately reads `handleList.get(0)` to resolve the broker address.

If an empty handle list reaches this service method, it throws `IndexOutOfBoundsException` before returning a failed future with a meaningful Proxy error.

### Steps to Reproduce

1. Call `ClusterMessageService.batchAckMessage()` with an empty `handleList`.
2. Observe that `handleList.get(0)` is evaluated without a non-empty guard.

### What Did You Expect to See?

The method should reject an empty batch ack request with a stable failed future and a meaningful Proxy error. It should not call the broker client because there is no receipt handle from which a broker can be resolved.

### What Did You See Instead?

The method can throw `IndexOutOfBoundsException`.

### Additional Context

This is a small Proxy runtime robustness fix for the batch ack path.

Contributor guide

Open the contributing guide

Research direction

Start at ClusterMessageService.batchAckMessage() and trace how handleList is converted into extraInfoList and used to resolve the broker address. Exercise the method with an empty handleList, then verify it returns a stable failed future with a meaningful Proxy error without calling the broker client.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.