Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-19265

Potential NPE and hiding actual exception in Hive#copyFiles

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • 4.0.0-alpha-1
    • None
    • None

    Description

      In Hive#copyFiles we have such code

      if (src.isDirectory()) {
              try {
                files = srcFs.listStatus(src.getPath(), FileUtils.HIDDEN_FILES_PATH_FILTER);
              } catch (IOException e) {
                pool.shutdownNow();
                throw new HiveException(e);
              }
            }
      

      If pool is null we will get NPE and actual cause will be lost.

      Initializing of pool

          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;
      

      So in the case when the pool is not created we can get potential NPE and swallow an actual exception

      Attachments

        1. HIVE-19265.01.patch
          0.7 kB
          Igor Kryvenko

        Activity

          People

            ikryvenko Igor Kryvenko
            ikryvenko Igor Kryvenko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: