-
Notifications
You must be signed in to change notification settings - Fork 228
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
Fix NPE in IntermedaiteStateCalcStage #2974
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 for fixing the test!! Good job!
@@ -865,7 +865,9 @@ private void computeIntermediateMap(PartitionStateMap intermediateStateMap, | |||
if (!value.getToState().equals(HelixDefinedState.DROPPED.name())) { | |||
intermediateStateMap.setState(entry.getKey(), value.getTgtName(), value.getToState()); | |||
} else { | |||
intermediateStateMap.getStateMap().get(entry.getKey()).remove(value.getTgtName()); | |||
if (intermediateStateMap.getStateMap().containsKey(entry.getKey())) { |
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.
why not use else if instead of inner if statement.
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.
Good catch. Was just coding on auto pilot. Updated
Pull request approved by: @junkaixue CI Failed due to recurrent flaky test |
Fix NPE in IntermediateStateCalcStage
Issues
#2973
Description
NPE can occur during
IntermedaiteStateCalcStage
Details can be found in the issue page #2973
Tests
testMessageAlreadyApplied
inTestIntermediateStateCalcStage
Without the null check in in IntermediateStateCalcStage, this will produce an identical NPE
Changes that Break Backward Compatibility (Optional)
N/A
Documentation (Optional)
(Link the GitHub wiki you added)
Commits
Code Quality
(helix-style-intellij.xml if IntelliJ IDE is used)