balodesecurity opened a new pull request, #8314:
URL: https://github.com/apache/hadoop/pull/8314
## Problem
In `QuorumJournalManager`, nine methods catch `InterruptedException` and
`TimeoutException` and rethrow as `IOException` without chaining the original
exception as the cause:
```java
} catch (InterruptedException e) {
throw new IOException("Interrupted waiting for format() response");
// ^ no
cause!
}
```
Affected methods: `format`, `hasSomeData`, `doPreUpgrade`, `doUpgrade`,
`doFinalize`, `canRollBack`, `doRollback`, `discardSegments`, `getJournalCTime`.
When these exceptions surface in logs or are caught upstream, the original
stack trace (and the interrupted thread's state) is lost entirely, making the
root cause of failures invisible during debugging.
## Fix
Pass the caught exception as the second argument to `IOException(String,
Throwable)` in all 18 affected catch blocks, preserving the full exception
chain.
## Testing
- Added
`TestQuorumJournalManagerUnit#testFormatTimeoutExceptionIsCauseChained`:
configures a QJM with a 50 ms operations timeout, makes all loggers return
futures that never resolve, calls `format()`, and asserts that the thrown
`IOException` has a `TimeoutException` as its cause.
- Test passes locally.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]