RockteMQ-AI commented on issue #11460:
URL: https://github.com/apache/rocketmq/issues/11460#issuecomment-6287440185

   **Issue Evaluation**
   
   Category: `type/bug` | Status: **Confirmed**
   
   The reported issue has been verified against the current codebase on the 
`develop` branch.
   
   **Root Cause:** In `CheckpointFile.read(String)` (lines 107, 110), 
`Integer.parseInt(reader.readLine())` throws `NumberFormatException` 
(unchecked) when the primary file header is malformed or empty. The public 
`read()` method (line 144) only catches `IOException`, so the 
`NumberFormatException` escapes without attempting the valid `.bak` backup 
recovery path.
   
   **Impact:** `common` module — checkpoint file recovery is bypassed when the 
primary file header is corrupted, even if the backup is intact. This affects 
components relying on `CheckpointFile` for durable state (e.g., consumer offset 
checkpoints, HA checkpoint).
   
   **Severity:** Medium — affects fault-tolerance recovery path, not the normal 
I/O path.
   
   **Verified reproduction:**
   - Primary file contains `"invalid\n0\nvalue\n"` → `NumberFormatException` 
escapes
   - Backup file is valid but never reached
   - Control: standalone backup read works correctly
   
   Wrapping the `parseInt` calls or broadening the catch clause to include 
`NumberFormatException` resolves this. An automated fix proposal may be 
generated. Reply `/approve` to proceed with PR generation.
   
   ---
   *Automated evaluation by RockteMQ-AI*


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