chihsuan opened a new pull request, #10178: URL: https://github.com/apache/ozone/pull/10178
## What changes were proposed in this pull request? `XceiverClientGrpc.sendCommandWithRetry` iterates over the pipeline's datanodes and stashes any caught exception into a local `ioException` so it can be re-thrown after the loop. The `InterruptedException` branch only logged the error and restored the interrupt flag — it neither assigned `ioException` nor exited the loop. Because restoring the interrupt flag causes any subsequent `Future.get()` to throw `InterruptedException` immediately, every remaining iteration also fell into the same broken branch, and the loop terminated with `responseProto == null` **and** `ioException == null`. The post-loop `Objects.requireNonNull(ioException, "ioException == null")` then threw `NullPointerException`, masking the real interrupt cause and producing a confusing stack trace during graceful shutdown of EC reconstruction tasks. This PR fixes the `catch (InterruptedException)` branch to throw an `InterruptedIOException` (chained to the original `InterruptedException` via `initCause`) immediately after restoring the flag. The shape of the catch block now matches the existing convention already used twice in the same file (`sendCommand` at lines 313-318 and 404-409) and the SPI base class. A new test exercises the path: it pre-sets the interrupt flag on the test thread, drives a command through `XceiverClientGrpc`, and verifies that the call surfaces `InterruptedIOException` (not `NullPointerException`), preserves the original `InterruptedException` as the cause, and leaves the interrupt flag set so callers can still detect the interrupt. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-14830 ## How was this patch tested? - New unit test `TestXceiverClientGrpc#testInterruptedCommandThrowsInterruptedIOException` covering the regression. The test pre-sets the interrupt flag, returns a never-completing `CompletableFuture` from a stubbed `sendCommandAsync`, and asserts: - the call throws `InterruptedIOException`, - the cause is the original `InterruptedException`, - the interrupt flag is still set after the throw (the contract that callers rely on). The test clears the interrupt flag in a `finally` before `XceiverClientGrpc.close()` runs to avoid disturbing channel shutdown. - `mvn checkstyle:check -pl hadoop-hdds/client,hadoop-ozone/integration-test` reports 0 violations. -- 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]
