Skip to content

HDDS-8950. NPE in SCMCommonPlacementPolicy#validateContainerPlacement#4999

Merged
adoroszlai merged 1 commit intoapache:masterfrom
adoroszlai:HDDS-8950
Jun 28, 2023
Merged

HDDS-8950. NPE in SCMCommonPlacementPolicy#validateContainerPlacement#4999
adoroszlai merged 1 commit intoapache:masterfrom
adoroszlai:HDDS-8950

Conversation

@adoroszlai
Copy link
Contributor

What changes were proposed in this pull request?

Fix NPE in validateContainerPlacement which can happen when trying to get placement group for dead node.

Strictly speaking the fix is only this part:

-            .collect(Collectors.groupingBy(this::getPlacementGroup,
+        .map(this::getPlacementGroup)
+        .filter(Objects::nonNull)
+        .collect(Collectors.groupingBy(
+            Function.identity(),

https://issues.apache.org/jira/browse/HDDS-8950

How was this patch tested?

Added unit test.

https://github.com/adoroszlai/hadoop-ozone/actions/runs/5400935177

@adoroszlai adoroszlai self-assigned this Jun 28, 2023
@adoroszlai adoroszlai added bug Something isn't working scm labels Jun 28, 2023
Copy link
Contributor

@sodonnel sodonnel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Nice work figuring out to root cause.

@adoroszlai adoroszlai merged commit 4dd44a4 into apache:master Jun 28, 2023
@adoroszlai adoroszlai deleted the HDDS-8950 branch June 28, 2023 20:29
@adoroszlai
Copy link
Contributor Author

Thanks @sodonnel for the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working scm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments