[Bug] Proxy gRPC telemetry write failure logs full TelemetryCommand payload
- 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 Discussions.
- [x] I have searched the existing issues and believe that this is not a duplicate.
- [x] I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.
### Runtime platform environment
All platforms running RocketMQ Proxy with gRPC clients.
### RocketMQ version
develop branch
### JDK Version
All supported JDK versions
### Describe the Bug
`GrpcClientChannel.writeTelemetryCommand` logs the full `TelemetryCommand` when the telemetry observer is missing or when `observer.onNext(command)` fails.
Some telemetry commands can contain user message data or large diagnostic payloads. For example:
- `VerifyMessageCommand` carries a message when Proxy asks a client to consume a message directly.
- `RecoverOrphanedTransactionCommand` carries a message for transaction recovery.
- Other telemetry commands may also carry verbose diagnostics.
When a client disconnects or the telemetry stream is already completed, this failure path can write the complete protobuf command into Proxy logs. That makes troubleshooting noisier and may expose message payloads in operational logs.
Relevant code:
```java
log.warn("telemetry command observer is null when try to write data. command:{}, channel:{}", TextFormat.shortDebugString(command), this);
...
log.warn("write telemetry failed. command:{}", command, exception);
```
### Steps to Reproduce
1. Create a gRPC client channel in Proxy.
2. Send a telemetry command that carries a message payload, such as `VerifyMessageCommand`.
3. Make the telemetry observer missing or closed before `writeTelemetryCommand` writes the command.
4. Observe Proxy logs.
### What Did You Expect to See?
Proxy should log a compact command summary, such as command type and channel/client ID, without serializing the full protobuf payload.
### What Did You See Instead?
Proxy logs the full `TelemetryCommand`, which can include message content and make runtime diagnostics noisy or sensitive.
### Additional Context
This is related to Proxy-side gRPC client runtime diagnostics. The fix should be additive and local to logging: replace full command logging with a sanitized command summary while preserving enough context to debug telemetry write failures.
Contributor guide
Research direction
Start at GrpcClientChannel.writeTelemetryCommand and inspect the two warning paths described in the issue: a missing observer and an onNext failure. Reproduce the telemetry write failure with a payload-bearing command, then verify that logs retain the command type and channel or client context without serializing the full TelemetryCommand.
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
- Clearly specified
- Newbie friendliness
- 76/100