NPE in canCompleteSwap if path doesn't exists
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 50/100
Research direction
Start in helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixAdmin.java at lines 552-555 and trace the canCompleteSwap REST entry point. Reproduce the case with a corrupted or missing path, then verify that the operation returns true without an NPE.
Written by the indexing model from the issue text.
Description
Describe the bug
Currently when we call baseAccessor.getChildNames and if the path doesnt exists, swapOutResources is null, and we iterate over this which results in NPE
"error" : "Cannot invoke \"java.util.List.iterator()\" because \"swapOutResources\" is null"
}
To Reproduce
Hit canCompleteSwap Rest and manually corrupt the path.
Expected behavior
NPEs should be handled, it should return true in this case as well.
Additional context
Add any other context about the problem here.
- Dominant language
- Java
- Stars
- 505
- Forks
- 258
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/helix
-
Four TestConstraintBasedAlgorithm tests pass when nothing is thrownPossibly taken @sharanggupta claimed this today. Open
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
-
Helix ZkClient times out after successful ZooKeeper SASL DIGEST-MD5 authenticationPossibly taken @adityaanikam claimed this 43 days ago. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Legacy IZkStateListenerI0ItecImpl causes zombie participants by discarding session IDsPossibly taken @LZD-PratyushBhatt claimed this 457 days ago. Openbug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
bug documentation good first issue help wanted priority low size XS
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
martin-francois/symphony-trello#1351 ·
Maintainers usually reply within 1 day
-
Add test coverage for ConvertUtil.parseDate() with NULL inputPossibly taken @mirajul-mollah7 claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 78/100
eclipse-sw360/sw360#4792 · 1 comment ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
aws/aws-emulator#30 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 4 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100