Uploaded image for project: 'CDAP'
  1. CDAP
  2. CDAP-13110

In some cases, a dataset's class loader is closed before the dataset is closed

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.3.3
    • Fix Version/s: 5.0.0, 4.3.4
    • Component/s: Datasets, Explore
    • Labels:
    • Release Notes:
      Fixes an issue where a dataset's class loader was closed before the dataset itself, preventing the dataset from closing properly.
    • Rank:
      1|i00auf:

      Description

      For example, here in ExploreTableManager:

          Dataset dataset = null;
          try (SystemDatasetInstantiator datasetInstantiator = datasetInstantiatorFactory.create()) {
            dataset = datasetInstantiator.getDataset(datasetId);
            return generateEnableStatement(dataset, spec, datasetId,
                                           tableNaming.getTableName(datasetId, spec.getProperties()), truncating);
          } catch (IOException e) {
            LOG.error("Exception instantiating dataset {}.", datasetId, e);
            throw new ExploreException("Exception while trying to instantiate dataset " + datasetId);
          } finally {
            Closeables.closeQuietly(dataset);
          }
      

      The closing of the dataset happens after the (AutoCloseable) SystemDatasetInstantiator is closed. There a handful similar places in the code that have the same issue.

        Attachments

          Activity

            People

            • Assignee:
              andreas Andreas Neumann
              Reporter:
              andreas Andreas Neumann
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: