[
https://issues.apache.org/jira/browse/HIVE-19265?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ashutosh Chauhan updated HIVE-19265:
------------------------------------
Resolution: Fixed
Fix Version/s: 3.1.0
Status: Resolved (was: Patch Available)
Pushed to master. Thanks, Igor!
> Potential NPE and hiding actual exception in Hive#copyFiles
> -----------------------------------------------------------
>
> Key: HIVE-19265
> URL: https://issues.apache.org/jira/browse/HIVE-19265
> Project: Hive
> Issue Type: Bug
> Reporter: Igor Kryvenko
> Assignee: Igor Kryvenko
> Priority: Critical
> Fix For: 3.1.0
>
> Attachments: HIVE-19265.01.patch
>
>
> {{In Hive#copyFiles}} we have such code
> {code:java}
> if (src.isDirectory()) {
> try {
> files = srcFs.listStatus(src.getPath(),
> FileUtils.HIDDEN_FILES_PATH_FILTER);
> } catch (IOException e) {
> pool.shutdownNow();
> throw new HiveException(e);
> }
> }
> {code}
> If pool is null we will get NPE and actual cause will be lost.
> Initializing of pool
> {code:java}
> final ExecutorService pool =
> conf.getInt(ConfVars.HIVE_MOVE_FILES_THREAD_COUNT.varname, 25) > 0 ?
>
> Executors.newFixedThreadPool(conf.getInt(ConfVars.HIVE_MOVE_FILES_THREAD_COUNT.varname,
> 25),
> new
> ThreadFactoryBuilder().setDaemon(true).setNameFormat("Move-Thread-%d").build())
> : null;
> {code}
> So in the case when the pool is not created we can get potential NPE and
> swallow an actual exception
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)