You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "123123213weqw (via GitHub)" <gi...@apache.org> on 2026/08/01 15:08:36 UTC
[PR] fix: make trace data decoding resilient to malformed lines [rocketmq-dashboard]
123123213weqw opened a new pull request, #744:
URL: https://github.com/apache/rocketmq-dashboard/pull/744
### Problem
`MsgTraceDecodeUtil.decoderFromTraceDataString` parses each trace line by accessing `line[1..N]` and calling `Integer.parseInt` / `Long.parseLong` / `MessageType.values()[i]` **without validating the field count or the values**.
A single malformed trace line — too few fields, or a non-numeric value — throws `ArrayIndexOutOfBoundsException` / `NumberFormatException`. That exception propagates out of the decoding loop, so `MessageTraceView.decodeFromTraceTransData` (which has no try/catch) fails, and the whole message-trace query returns an error — even though all the other trace lines were perfectly valid.
Since trace data comes from message bodies (potentially produced by mixed client versions or corrupted), a malformed line is plausible and should not break the entire result.
### Fix
Decode each trace context in isolation: wrap the per-line parsing in a `try/catch` and skip (with a warning log) any line that fails to parse, so one bad line no longer aborts the rest.
### Verification
`mvn compiler:compile` passes (`BUILD SUCCESS`).
### Diff
1 file changed (the change is mostly re-indentation from wrapping the loop body in a try/catch).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Studio] Skip malformed message trace lines [rocketmq-dashboard]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins closed pull request #744: [Studio] Skip malformed message trace lines
URL: https://github.com/apache/rocketmq-dashboard/pull/744
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Studio] Skip malformed message trace lines [rocketmq-dashboard]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on PR #744:
URL: https://github.com/apache/rocketmq-dashboard/pull/744#issuecomment-5252653385
Closing: based on the legacy src/ layout, and the functionality is covered by the rewritten studio implementation. RocketMQMessageProvider.parseTraceBody already wraps each line in try/catch and skips malformed entries.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Studio] Skip malformed message trace lines [rocketmq-dashboard]
Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on code in PR #744:
URL: https://github.com/apache/rocketmq-dashboard/pull/744#discussion_r3721559060
##########
src/main/java/org/apache/rocketmq/dashboard/util/MsgTraceDecodeUtil.java:
##########
@@ -50,113 +50,119 @@ public static List<TraceContext> decoderFromTraceDataString(String traceData) {
}
Review Comment:
No test changes detected alongside source modifications. Consider adding tests to cover the changes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: make trace data decoding resilient to malformed lines [rocketmq-dashboard]
Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on PR #744:
URL: https://github.com/apache/rocketmq-dashboard/pull/744#issuecomment-5153321963
## PR Review for #744: fix: make trace data decoding resilient to malformed lines
### Summary
This PR modifies 1 file(s) with +111/-105 lines changed.
### Changed Files
- src/main/java/org/apache/rocketmq/dashboard/util/MsgTraceDecodeUtil.java
### Observations
- PR author: @123123213weqw
- Diff size: 13548 characters
- 112 additions, 106 deletions in diff
### Next Steps
A detailed code-level review requires the code engine. This is a structural overview only.
Please verify correctness, thread safety, and backward compatibility manually.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org