You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Konstantin Ryakhovskiy (Jira)" <ji...@apache.org> on 2023/08/04 08:26:00 UTC
[jira] [Updated] (HBASE-27995) Missing null check in TestHFile
[ https://issues.apache.org/jira/browse/HBASE-27995?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Konstantin Ryakhovskiy updated HBASE-27995:
-------------------------------------------
Attachment: HBASE-27995.patch
> Missing null check in TestHFile
> --------------------------------
>
> Key: HBASE-27995
> URL: https://issues.apache.org/jira/browse/HBASE-27995
> Project: HBase
> Issue Type: Bug
> Reporter: ConfX
> Priority: Critical
> Attachments: HBASE-27995.patch, reproduce.sh
>
>
> h2. What happened
> After setting {{{}hbase.lru.blockcache.hard.capacity.limit.factor=-0.4921875{}}}, running test {{{}org.apache.hadoop.hbase.io.hfile.TestHFile#testReaderWithAdaptiveLruCombinedBlockCache{}}}results in a null pointer exception.
> h2. Where's the problem
> In the test:
> {noformat}
> cachedBlock = combined.getBlock(key, false, false, true);
> try {
> ...
> } finally {
> cachedBlock.release();
> }{noformat}
> However, cacheBlock might not be initialized properly and could be null, causing an unhandled NullPointerException.
> h2. How to reproduce
> # set {{hbase.lru.blockcache.hard.capacity.limit.factor}} to {{-0.4921875 }}
> # run {{org.apache.hadoop.hbase.io.hfile.TestHFile#testReaderWithAdaptiveLruCombinedBlockCache}}
> you should observe
> {noformat}
> java.lang.NullPointerException
> at org.apache.hadoop.hbase.io.hfile.TestHFile.testReaderCombinedCache(TestHFile.java:1052)
> at org.apache.hadoop.hbase.io.hfile.TestHFile.testReaderWithAdaptiveLruCombinedBlockCache(TestHFile.java:1011){noformat}
> For an easy reproduction, run the reproduce.sh in the attachment.
> We are happy to provide a patch if this issue is confirmed.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)