Uh oh!
There was an error while loading. Please reload this page.
HDDS-10367. Fix possible NullPointerException in listKeysLight method - #6221
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…rotocolPB/OzoneManagerProtocolClientSideTranslatorPB.java Co-authored-by: Maksim Myskov <maxim.myskov@gmail.com>
adoroszlai
left a comment
There was a problem hiding this comment.
Thanks @ivanzlenko for the patch.
Please add test case (for non-light listStatus) in TestListStatus#testSortedListStatus.
ivanzlenko
commented
Feb 19, 2024
@adoroszlai I've added additional test cases but looking at test coverage all changes were covered already. Looks like some of the issues with s3a protocol were fixed in HDDS-9762, but my fixes should prevent future cases where we accidentally could pass 'null' for startKey. |
adoroszlai
left a comment
There was a problem hiding this comment.
Thanks @ivanzlenko for updating the patch.
Uh oh!
There was an error while loading. Please reload this page.
kerneltime
commented
Feb 20, 2024
adoroszlai
left a comment
There was a problem hiding this comment.
Thanks @ivanzlenko for restoring package in the test class.
Interestingly, the new test case passes without the added null checks, so it does not seem to exercise the code path being changed.
ivanzlenko
commented
Feb 21, 2024
@adoroszlai we have some preliminary checks for nulls in intermediary code. So this test cases here for good measure. I believe we would've caught HDDS-9762 earlier having cases with null value. |
Uh oh!
There was an error while loading. Please reload this page.
| if (startKey != null) { | ||
| listStatusRequestBuilder.setStartKey(startKey); | ||
| } |
There was a problem hiding this comment.
Since this is also a ListStatusRequest, I think we need to set "" in else branch here, too.
sumitagrawl
left a comment
There was a problem hiding this comment.
@ivanzlenko Thanks for working over this, its fix for consistency with listKeys, but do not have any NullPointerException as startKey as null is expected value.
And for improving test cases.
adoroszlai
commented
Feb 28, 2024
Thanks @ivanzlenko for the patch, @myskov, @sumitagrawl for the review. |
ivanzlenko
commented
Feb 28, 2024
@myskov@sumitagrawl@adoroszlai thanks for review! |
…Light (apache#6221) (cherry picked from commit 1830fe2) Change-Id: Ib7da5a7886b3a3a39b900f9f3e7ba0e406547153
…Light (apache#6221) (cherry picked from commit 1830fe2)
What changes were proposed in this pull request?
Fix possible NullPointerException which can occur in some cases while invoking listKeysLight from OzoneManagerProtocolClientSideTranslatorPB.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-10367
How was this patch tested?
This patch is test manually.
Separate epic created to cover testing of hdfs client with S3A protocol: https://issues.apache.org/jira/browse/HDDS-10381