apache / apache/rocketmq

[Bug] Proxy gRPC converter should tolerate malformed timer properties

Open Beginner friendly
#10,685 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

### Bug description

`GrpcConverter.buildSystemProperties` parses timer message properties with `Long.parseLong` when building the gRPC `SystemProperties.delivery_timestamp` field:

- `MessageConst.PROPERTY_TIMER_DELAY_SEC`
- `MessageConst.PROPERTY_TIMER_DELIVER_MS`

If either property is present but malformed, `buildMessage` can throw `NumberFormatException` while converting a Broker `MessageExt` into the gRPC v2 `Message` response. This can make a single malformed timer property fail the whole gRPC message response/query conversion path.

### Expected behavior

The converter should tolerate malformed optional timer properties. Valid timer properties should still set `delivery_timestamp`; malformed values should be ignored with a diagnostic warning instead of failing the message conversion.

### Affected area

`proxy` module, gRPC v2 message conversion.

### Suggested fix

- Parse timer properties through a safe helper.
- Keep existing behavior for valid `PROPERTY_TIMER_DELAY_SEC` and `PROPERTY_TIMER_DELIVER_MS` values.
- Ignore malformed values and log a warning with diagnostic context.
- Add unit tests for valid and malformed timer properties.

Contributor guide

Open the contributing guide

Research direction

Start in the proxy module at GrpcConverter.buildSystemProperties and follow its use from buildMessage. Check how PROPERTY_TIMER_DELAY_SEC and PROPERTY_TIMER_DELIVER_MS are parsed, then add unit tests covering valid and malformed values. Done means valid properties still set delivery_timestamp while malformed optional values are ignored with a warning and conversion continues.

Written by the indexing model from the issue text.

Assessment

Tech stack
grpc, java
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.