xiaoyuyao commented on a change in pull request #752: HDDS-1430. NPE if secure
ozone if KMS uri is not defined. Contributed by Ajay Kumar.
URL: https://github.com/apache/hadoop/pull/752#discussion_r276858612
##########
File path:
hadoop-ozone/ozonefs/src/main/java/org/apache/hadoop/fs/ozone/OzoneFileSystem.java
##########
@@ -59,7 +59,13 @@ public URI getKeyProviderUri() throws IOException {
@Override
public DelegationTokenIssuer[] getAdditionalTokenIssuers()
throws IOException {
- KeyProvider keyProvider = getKeyProvider();
+ KeyProvider keyProvider;
+ try {
+ keyProvider = getKeyProvider();
+ } catch (IOException ioe) {
+ LOG.error("Error retrieving KeyProvider.", ioe);
+ return null;
+ }
if (keyProvider instanceof DelegationTokenIssuer) {
Review comment:
Why don't we just check keyProvider!=null on Line 69 before check if
keyProvider instanceof? This way, we don't need other changes.
Note getKeyProvider() will be eventually fixed when OM returns its KMS uri
to the client as part of it service discovery.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]