Description
There is an issue in specific Ranger versions (where RANGER-3989 is not fixed) which throws Exception in case of concurrent access to a HashMap with Message null.
java.util.ConcurrentModificationException: null at java.util.HashMap$HashIterator.nextNode(HashMap.java:1469) at java.util.HashMap$EntryIterator.next(HashMap.java:1503) at java.util.HashMap$EntryIterator.next(HashMap.java:1501)
This manifests in Hadoop's KeyShell as an Exception with message null.
So when
private String prettifyException(Exception e) { return e.getClass().getSimpleName() + ": " + e.getLocalizedMessage().split("\n")[0]; }
tries to print out the Exception the user experiences NPE
Exception in thread "main" java.lang.NullPointerException at org.apache.hadoop.crypto.key.KeyShell.prettifyException(KeyShell.java:541) at org.apache.hadoop.crypto.key.KeyShell.printException(KeyShell.java:536) at org.apache.hadoop.tools.CommandShell.run(CommandShell.java:79) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:81) at org.apache.hadoop.crypto.key.KeyShell.main(KeyShell.java:553)
This is an unwanted behaviour because the user does not have any feedback what and where went wrong.
My suggestion is to add null checking into the affected prettifyException method.
I'll create the Github PR soon.
Attachments
Issue Links
- relates to
-
RANGER-3989 KMS APIs fail due to ConcurrentModificationException
- Resolved