[Bug] Proxy gRPC client settings should tolerate malformed metric collector address
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start at GrpcClientSettingsManager.mergeMetric in the proxy module and trace how metricCollectorAddress becomes the Metric settings response. Add unit tests for valid, empty, host-only, and non-numeric-port addresses; done means malformed optional endpoints no longer throw, disable client metrics, and valid host:port values remain unchanged.
Written by the indexing model from the issue text.
Description
Bug description
When the proxy is configured with metricCollectorMode=on, GrpcClientSettingsManager.mergeMetric parses metricCollectorAddress with split(":") and directly reads split[1] / Integer.parseInt(split[1]).
If metricCollectorAddress is empty, missing the port, or has a non-numeric port, the gRPC client settings path can throw runtime exceptions while constructing the Metric settings response:
- empty or host-only value:
ArrayIndexOutOfBoundsException - non-numeric port:
NumberFormatException
This makes a malformed optional metrics collector config affect normal gRPC client telemetry/settings negotiation.
Expected behavior
The proxy should not fail gRPC client settings generation because the optional client metric collector endpoint is malformed. It should reject/ignore the malformed endpoint and return settings with client metrics disabled, while keeping valid host:port values unchanged.
Affected area
proxy module, gRPC v2 client settings / telemetry path.
Suggested fix
Validate metricCollectorAddress before constructing Endpoints:
- require non-blank
host:port - require a numeric port
- on invalid values, log a warning and set
Metric.on=false - add unit tests for valid, empty, missing-port, and non-numeric-port addresses
- Dominant language
- Java
- Stars
- 22.6k
- Forks
- 12k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 25
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/rocketmq
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
[Bug] TopicValidator rejects V2 retry topic names containing `+` separator introduced by KeyBuilder Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100