The GitHub Actions job "Build and Run Tests by Maven" on 
rocketmq.git/fix/trace-data-encoder-malformed-line has failed.
Run started by GitHub user zjncs (triggered by zjncs).

Head commit for run:
6ee859bc7f18d09862f60fbee2544538cb77b86f / zjncs <[email protected]>
[ISSUE #D3] Skip malformed trace lines instead of aborting the whole decode

decoderFromTraceDataString splits a trace-topic payload into lines and
indexes fixed positions per line type (e.g. Pub reads line[0]..line[11])
with unguarded Long/Integer.parseInt and MessageType.values()[...] /
LocalTransactionState.valueOf lookups. The trace topic is a plain topic
any client can publish to, and the method itself carries
'compatible with the old version' branches because the field layout
differs across client versions. A single truncated, corrupted or
foreign-version line therefore throws ArrayIndexOutOfBoundsException or
NumberFormatException and aborts decoding of every remaining context in
the payload.

That exception surfaces in mqadmin queryMsgTraceById (TraceView
.decodeFromTraceTransData -> this decoder), which fails the whole
command because of one bad line.

Wrap the per-line parsing in try/catch and skip (with a warn log
including the offending line) so the remaining contexts are still
returned.

Tests (TraceDataEncoderTest):
- truncated Pub line followed by a valid one: AIOOBE before, valid line
  decoded after
- non-numeric timestamp followed by a valid line: NumberFormatException
  before, valid line decoded after
- out-of-range msgType ordinal: AIOOBE before, valid line decoded after
Full class: 11/11 plus TraceViewTest 1/1.

Signed-off-by: zjncs <[email protected]>

Report URL: https://github.com/apache/rocketmq/actions/runs/34440398750

With regards,
GitHub Actions via GitBox

Reply via email to