zmuxuny opened a new pull request, #11214:
URL: https://github.com/apache/rocketmq/pull/11214

   ### Which Issue(s) This PR Fixes
   
   - Fixes #10837
   
   ### Brief Description
   
   A truncated trace entry currently throws while `decoderFromTraceDataString` 
indexes or parses its fields, so valid entries later in the same trace message 
are lost. Decode each entry independently and skip entries with missing or 
invalid required fields. Preserve trailing empty fields, which are valid for a 
`SubBefore` entry with no keys, and keep the older 12-field `Pub` format 
readable.
   
   The earlier #10847 was closed without merging. This version also handles 
records cut off at a numeric field, where a field-count check alone still 
throws, and tests all five trace types for later-record recovery.
   
   ### How Did You Test This Change?
   
   - Reproduced `ArrayIndexOutOfBoundsException` for a valid empty-key 
`SubBefore` entry and `NumberFormatException` for a record cut off at its 
numeric message-type field before the fix.
   - `JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 
PATH=/usr/lib/jvm/java-11-openjdk-amd64/bin:$PATH mvn -B -ntp -pl client -am 
-Dtest=TraceDataEncoderTest -Dsurefire.failIfNoSpecifiedTests=false test` — 12 
tests passed, including the new truncated-record, numeric-boundary, 
legacy-format, and empty-key cases. The Maven lifecycle ran Checkstyle and 
SpotBugs.
   - `git diff --check` — passed.
   


-- 
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