smengcl opened a new pull request, #11697: URL: https://github.com/apache/ozone/pull/11697
Generated-by: Claude Code (Opus 5.5) ## What changes were proposed in this pull request? **SCM client fails fast on errors that will not change on retry.** `SCMHAUtils.getRetryAction` fails over and retries any exception that is not in its known lists, including an ordinary error returned by SCM. With the defaults that is 300 attempts, about 10 minutes. For example, `ozone admin containerbalancer stop` when the balancer is not running prints "Retrying" for 10 minutes before showing the error. SCM already converts the errors worth retrying (not leader, leader not ready, Ratis reconfiguration, etc.) to `ServerNotLeaderException`, `RetriableWithFailOverException` or `RetriableWithNoFailoverException`, the RPC server returns `RetriableException` when it is too busy, and Ratis timeouts arrive as `SCMException`, which already fails without retry. So `checkNonRetriableException` now also returns true for any other exception returned by SCM. Exceptions are matched by class name, because the `Retriable*` exceptions cannot be unwrapped from `RemoteException` (no `String` constructor). Connection failures and timeouts on the client side are still retried as before. **`ozone admin safemode wait -t` honors its timeout.** The deadline was only checked between calls to SCM, and each call could take the full SCM client retry budget. Its "SCM is not available (yet?)" branch only caught `InterruptedException`, so an error from SCM ended the command instead of retrying. Now the `inSafeMode` call runs in a separate thread with the remaining time as its deadline, and errors are retried until the timeout. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-17318 ## How was this patch tested? Added unit tests, which fail without the fix: * `TestSCMHAUtils`: exceptions returned by SCM fail without retry, unless they are one of the retriable ones above; connection failures are still retried. * `TestSafeModeWaitSubcommand`: the command retries after an error until SCM is out of safe mode, and times out while a call to SCM is still in progress. Existing `TestSCMFailoverProxyProvider*` tests pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
