Hive: NPE in MetastoreLock.findLock() when ShowLocksResponse has no locks
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 25/100
Research direction
Start in MetastoreLock.findLock() at MetastoreLock.java:375, where ShowLocksResponse.getLocks() is iterated, and read the createLock() call path around lines 302–314. Check how the code handles a response with no locks while preserving the original TException. Done means this case no longer throws an NPE; an open linked pull request (#19235) already addresses the issue.
Written by the indexing model from the issue text.
Description
When lock() fails, MetastoreLock.createLock() calls findLock(), which iterates
ShowLocksResponse.getLocks() without a null check. locks is optional, and some metastores
return a response without it set. The resulting NPE hides the original TException from
lock().
java.lang.NullPointerException: Cannot invoke "java.util.List.iterator()" because the return value of "org.apache.hadoop.hive.metastore.api.ShowLocksResponse.getLocks()" is null
at org.apache.iceberg.hive.MetastoreLock.findLock(MetastoreLock.java:375)
at org.apache.iceberg.hive.MetastoreLock.lambda$createLock$...(MetastoreLock.java:314)
...
at org.apache.iceberg.hive.MetastoreLock.createLock(MetastoreLock.java:302)
at org.apache.iceberg.hive.MetastoreLock.acquireLock(MetastoreLock.java:185)
at org.apache.iceberg.hive.MetastoreLock.lock(MetastoreLock.java:146)
at org.apache.iceberg.hive.HiveTableOperations.doCommit(HiveTableOperations.java:272)
...
Affects 1.11.0, 1.12.0 and main.
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 3.7k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 170
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the 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/iceberg
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Spark: Test INSERT targets with computed IDENTIFIER expressionsPossibly taken @shivadarshan-devadiga claimed this 15 days ago. Openimprovement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
[Core] TestAvroPartitionStatsHandler fails on Windows due to unclosed partition statistics scanPossibly taken @Ankitkj1999 claimed this 17 days ago. Open
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Core: TableMetadata.Builder allows adding encryption keys to v1/v2 tablesPossibly taken @yusufyildiz34 claimed this 37 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/iceberg#18632 · 1 comment ·
Maintainers usually reply within 1 day
-
Kafka: Filter empty strings and whitespace in IcebergSinkConfig stringToListPossibly taken @mohamed-elbrik claimed this 42 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
Similar issues
-
bug vault
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
bancolombia/secrets-manager#150 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 92/100
HexaHexes/neoforge-mod-template#124 ·
Maintainers usually reply within 1 day
-
awaiting triage java new feature P2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
source-survicate: pagination reads pagination and stops after one page; substreams drop survey_idOpen
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
OpenLiberty/open-liberty#36410 ·
Maintainers usually reply within 1 day