-
Notifications
You must be signed in to change notification settings - Fork 502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HDDS-64. OzoneClientException should extend IOException. #7403
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @nandakumar131 for taking up this super old issue.
@@ -96,7 +95,7 @@ public class FindMissingPadding extends Handler implements SubcommandWithParent | |||
private final Set<OzoneKey> affectedKeys = new HashSet<>(); | |||
|
|||
@Override | |||
protected OzoneAddress getAddress() throws OzoneClientException { | |||
protected OzoneAddress getAddress() throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the more specific exception should be kept in throws
for all methods that do not otherwise throw IOException
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. I will update the patch.
} catch (IOException ex) { | ||
System.out.printf("Error: %s", ex.getMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can even completely remove catch
.
Exception is handled by parent command (all other subcommands except GetServiceRolesSubcommand
and UpdateRangerSubcommand
rely on that).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this, let me fix both GetServiceRolesSubcommand
and UpdateRangerSubcommand
.
Thanks @adoroszlai for the review! Addressed all the review comments. |
d6ea573
to
0c64cc8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @nandakumar131 for updating the patch.
Looks like a test relies on
Suggested fix: --- hadoop-ozone/dist/src/main/smoketest/om-ratis/testOMAdminCmd.robot
+++ hadoop-ozone/dist/src/main/smoketest/om-ratis/testOMAdminCmd.robot
@@ -22,5 +22,5 @@ Test Timeout 5 minutes
*** Test Cases ***
Check om admin command
- ${result} = Execute and checkrc ozone admin om roles -id=omServiceIdDefault 0
+ ${result} = Execute and ignore error ozone admin om roles -id=omServiceIdDefault
Should Contain ${result} This command works only on OzoneManager HA cluster. |
Thanks @adoroszlai for taking a look at the failure. I will update the PR with the suggested fix. |
hadoop-ozone/dist/src/main/smoketest/om-ratis/testOMAdminCmd.robot
Outdated
Show resolved
Hide resolved
Thanks @adoroszlai for the help and merging this patch. |
What changes were proposed in this pull request?
OzoneClientException should extend IOException.
To simplify exception handling OzoneClientException should extend IOException.
What is the link to the Apache JIRA
HDDS-64
How was this patch tested?
Existing unit test.