From ce87c8ee2656d090a0ab4f2789e5fc2c58fb071f Mon Sep 17 00:00:00 2001 From: kkfluous Date: Mon, 20 Apr 2026 15:18:26 +0800 Subject: [PATCH] docs(changelog): record gb32960 body parser block isolation Co-Authored-By: Claude Opus 4.7 (1M context) --- CHANGELOG.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51720ab2..9df12c3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,25 @@ --- +## [Unreleased] + +### Changed —— GB/T 32960 Body Parser 单块异常隔离 +- `Gb32960BodyParser` 主循环对单信息块的 parser 异常不再放弃整帧: + - 固定长度块(`fixedLength ≥ 0`):回滚 reader → 按 `fixedLen` 截取字节兜成 + `InfoBlock.Raw` → `continue` 继续解析后续块; + - 变长块(`fixedLength == -1`)或剩余字节不足:剩余字节全部兜成 `Raw` 后终止循环; + - `parser` 契约违反(声明 `fixedLen=X` 但实际读了 `Y`)仍抛 `DecodeException`, + 以暴露 parser bug,不走 lenient 兜底,避免静默误解析长期误判; + - 只捕获 `DecodeException` / `BufferUnderflowException` / `IndexOutOfBoundsException`, + `RuntimeException` 继续向上抛,保留 bug 可见性。 +- 新增配置 `lingniu.ingest.gb32960.parse.lenient-block-failure`(默认 `true`); + 需要回退严格模式时设为 `false`。 +- `InfoBlock.Raw` record 结构**未变**,下游 `Gb32960EventMapper` 按 `findBlock(Class)` + 类型匹配,新增 Raw 不影响业务事件映射。 +- 新增测试 `Gb32960BodyParserIsolationTest` —— 3 种隔离场景 + 严格模式回退,共 4 case。 + +--- + ## [0.1.0] — 2026-04-15 初始基线。多模块 Spring Boot 车辆遥测接入服务。