Igor Kryvenko created HIVE-19265:
------------------------------------

             Summary: 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


{{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)

Reply via email to