apache / apache/rocketmq

[Bug] Proxy lock/unlock batch MQ returns response without error code for empty queue set

Open Beginner friendly
#10,782 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 found a bug, not just asking a question, which should be created in GitHub Issues.
- [x] I have searched the existing issues and believe this is not a duplicate.
- [x] I have confirmed that this bug belongs to the current repository.

### Describe the Bug

Proxy remoting lockBatchMQ and unlockBatchMQ return immediately when the decoded MessageQueue set is empty, but the response only carries the request body and remark. The response code is never set.

Code evidence:

- proxy/src/main/java/org/apache/rocketmq/proxy/remoting/activity/ConsumerManagerActivity.java handles LOCK_BATCH_MQ.
- proxy/src/main/java/org/apache/rocketmq/proxy/remoting/activity/ConsumerManagerActivity.java handles UNLOCK_BATCH_MQ.
- In both empty mqSet branches, the code sets body and remark MessageQueue set is empty, then returns the response without setting a non-success ResponseCode.

This makes an invalid request ambiguous to remoting clients and operations tooling, because the protocol response does not explicitly signal failure.

### Expected Behavior

When mqSet is empty, Proxy should return a response with a clear failure code and remark instead of returning a response with an unset code.

### Scope

RocketMQ Studio Track 2 / Proxy Admin and remoting compatibility diagnostics.

### Proposed Fix

Set an explicit failure code, for example ResponseCode.SYSTEM_ERROR, for empty lock/unlock batch MQ requests, and add unit coverage for both paths.

Contributor guide

Open the contributing guide

Research direction

Start in proxy/src/main/java/org/apache/rocketmq/proxy/remoting/activity/ConsumerManagerActivity.java and inspect the LOCK_BATCH_MQ and UNLOCK_BATCH_MQ handlers, focusing on their empty mqSet branches and existing response handling. Trace the relevant response-code constants, then add unit coverage for both empty-queue paths. Done means both responses explicitly indicate failure and retain a clear remark.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.