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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to