apache / apache/rocketmq

[Bug] Proxy Remoting forwarding NPEs when bname extFields are absent

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

Description

## Reproduction

`AbstractRemotingActivity.request` reads `request.getExtFields().get(...)` before checking whether the ext-fields map exists. A valid decoded RemotingCommand may have no ext fields at all.

A request such as `PULL_MESSAGE` with `extFields == null` throws `NullPointerException` instead of returning the existing `VERSION_NOT_SUPPORTED` response for a missing `bname`.

## Expected behavior

Missing or null ext fields should use the same protocol-level error path as an ext-fields map that simply lacks `bname`; the request must not be converted into an internal server error.

## Scope

Guard the ext-fields lookup in `AbstractRemotingActivity` and add regressions for both normal forwarding and the SendMessageV2 field variant.

Contributor guide

Open the contributing guide

Research direction

Start in AbstractRemotingActivity.request and trace how extFields and bname are handled before proxy remoting forwarding. Add regression coverage for normal forwarding and the SendMessageV2 field variant, then verify that absent ext fields follow the existing VERSION_NOT_SUPPORTED response path without an internal server error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.