adoroszlai opened a new pull request #602: HDDS-2984. Allocate Block failing with NPE URL: https://github.com/apache/hadoop-ozone/pull/602 ## What changes were proposed in this pull request? NPE may happen in `SCMPipelineMetrics#incNumBlocksAllocated` if pipeline is not found while incrementing counter. Given that `Optional#ifPresent` is already checked, I think the intention was to allow such cases. The problem is that `Optional#of` does not allow `null`. This change simply replaces it with `Optional#ofNullable`. https://issues.apache.org/jira/browse/HDDS-2984 ## How was this patch tested? Passes existing tests, although I don't think any specific test covers this case.
---------------------------------------------------------------- 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]
